diff --git a/packages/db/migrations/0141.do.add_index_for_cleanup_to_user.sql b/packages/db/migrations/0141.do.add_index_for_cleanup_to_user.sql new file mode 100755 index 000000000..3936b9415 --- /dev/null +++ b/packages/db/migrations/0141.do.add_index_for_cleanup_to_user.sql @@ -0,0 +1,9 @@ +-- Type: DO +-- Name: add_index_for_cleanup_to_user +-- Description: Add index of status and updated_at to omnivore.user table for cleanup of deleted users + +BEGIN; + +CREATE INDEX IF NOT EXISTS user_status_updated_at_idx ON omnivore.user (status, updated_at); + +COMMIT; diff --git a/packages/db/migrations/0141.undo.add_index_for_cleanup_to_user.sql b/packages/db/migrations/0141.undo.add_index_for_cleanup_to_user.sql new file mode 100755 index 000000000..cee6bae43 --- /dev/null +++ b/packages/db/migrations/0141.undo.add_index_for_cleanup_to_user.sql @@ -0,0 +1,9 @@ +-- Type: UNDO +-- Name: add_index_for_cleanup_to_user +-- Description: Add index of status and updated_at to omnivore.user table for cleanup of deleted users + +BEGIN; + +DROP INDEX IF EXISTS user_status_updated_at_idx; + +COMMIT;