mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
improve data migration speed
This commit is contained in:
parent
86478c13d2
commit
eb0f0b6c4f
2 changed files with 24 additions and 0 deletions
12
packages/db/migrations/0128.do.create_index_for_foreign_key.sql
Executable file
12
packages/db/migrations/0128.do.create_index_for_foreign_key.sql
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
-- Type: DO
|
||||
-- Name: create_index_for_foreign_key
|
||||
-- Description: Create index for foreign keys on entity_label and highlight tables
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS entity_labels_library_item_id_idx ON omnivore.entity_labels(library_item_id)
|
||||
CREATE INDEX IF NOT EXISTS entity_labels_highlight_id_idx ON omnivore.entity_labels(highlight_id);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS highlight_library_item_id_idx ON omnivore.highlight (library_item_id);
|
||||
|
||||
COMMIT;
|
||||
12
packages/db/migrations/0128.undo.create_index_for_foreign_key.sql
Executable file
12
packages/db/migrations/0128.undo.create_index_for_foreign_key.sql
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
-- Type: UNDO
|
||||
-- Name: create_index_for_foreign_key
|
||||
-- Description: Create index for foreign keys on entity_label and highlight tables
|
||||
|
||||
BEGIN;
|
||||
|
||||
DROP INDEX IF EXISTS highlight_library_item_id_idx;
|
||||
|
||||
DROP INDEX IF EXISTS entity_labels_highlight_id_idx;
|
||||
DROP INDEX IF EXISTS entity_labels_library_item_id_idx;
|
||||
|
||||
COMMIT;
|
||||
Loading…
Reference in a new issue