create an index for searching by slug

This commit is contained in:
Hongbo Wu 2023-10-04 22:49:07 +08:00
parent 463231b26b
commit 1ace21405a
2 changed files with 4 additions and 0 deletions

View file

@ -11,8 +11,10 @@ CREATE INDEX IF NOT EXISTS highlight_library_item_id_idx ON omnivore.highlight (
CREATE INDEX IF NOT EXISTS user_profile_user_id_idx ON omnivore.user_profile (user_id);
CREATE INDEX IF NOT EXISTS library_item_slug_idx ON omnivore.library_item (slug);
-- create index for sorting
CREATE INDEX IF NOT EXISTS library_item_saved_at_idx ON omnivore.library_item (saved_at);
CREATE INDEX IF NOT EXISTS library_item_updated_at_idx ON omnivore.library_item (updated_at);
CREATE INDEX IF NOT EXISTS library_item_read_at_idx ON omnivore.library_item (read_at);
COMMIT;

View file

@ -4,8 +4,10 @@
BEGIN;
DROP INDEX IF EXISTS omnivore.library_item_read_at_idx;
DROP INDEX IF EXISTS omnivore.library_item_updated_at_idx;
DROP INDEX IF EXISTS omnivore.library_item_saved_at_idx;
DROP INDEX IF EXISTS omnivore.library_item_slug_idx;
DROP INDEX IF EXISTS omnivore.user_profile_user_id_idx;