-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/db/migrations/20240516093218_revisions_add_updated_at_index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type {Knex} from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
return knex.raw(` | ||
CREATE INDEX revisions_updated_at_idx ON revisions USING BTREE (updated_at); | ||
`); | ||
} | ||
|
||
export async function down(knex: Knex): Promise<void> { | ||
return knex.raw(` | ||
DROP INDEX revisions_updated_at_idx; | ||
`); | ||
} |
13 changes: 13 additions & 0 deletions
13
src/db/migrations/20240516093323_entries_add_created_at_index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type {Knex} from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
return knex.raw(` | ||
CREATE INDEX entries_created_at_idx ON entries USING BTREE (created_at); | ||
`); | ||
} | ||
|
||
export async function down(knex: Knex): Promise<void> { | ||
return knex.raw(` | ||
DROP INDEX entries_created_at_idx; | ||
`); | ||
} |
15 changes: 15 additions & 0 deletions
15
src/db/migrations/20240516093411_workbooks_add_order_indexes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type {Knex} from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
return knex.raw(` | ||
CREATE INDEX workbooks_created_at_idx ON workbooks USING BTREE (created_at); | ||
CREATE INDEX workbooks_updated_at_idx ON workbooks USING BTREE (updated_at); | ||
`); | ||
} | ||
|
||
export async function down(knex: Knex): Promise<void> { | ||
return knex.raw(` | ||
DROP INDEX workbooks_updated_at_idx; | ||
DROP INDEX workbooks_created_at_idx; | ||
`); | ||
} |
15 changes: 15 additions & 0 deletions
15
src/db/migrations/20240516093447_collections_add_order_indexes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type {Knex} from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
return knex.raw(` | ||
CREATE INDEX collections_created_at_idx ON collections USING BTREE (created_at); | ||
CREATE INDEX collections_updated_at_idx ON collections USING BTREE (updated_at); | ||
`); | ||
} | ||
|
||
export async function down(knex: Knex): Promise<void> { | ||
return knex.raw(` | ||
DROP INDEX collections_updated_at_idx; | ||
DROP INDEX collections_created_at_idx; | ||
`); | ||
} |