Skip to content

Commit

Permalink
fix: naive take on adding an index (#1466)
Browse files Browse the repository at this point in the history
* fix: naive take on adding an index

user_id on uploads should probably be indexed...

* chore: change migration number to avoid conflict
  • Loading branch information
drewdelano committed Jun 16, 2022
1 parent 3463b4a commit ebe9bd0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX CONCURRENTLY IF NOT EXISTS upload_user_id_deleted_at_idx ON upload (user_id) WHERE deleted_at IS NULL;
1 change: 1 addition & 0 deletions packages/db/postgres/tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ CREATE TABLE IF NOT EXISTS upload
);

CREATE INDEX IF NOT EXISTS upload_auth_key_id_idx ON upload (auth_key_id);
CREATE INDEX IF NOT EXISTS upload_user_id_deleted_at_idx ON upload (user_id) WHERE deleted_at IS NULL;
CREATE INDEX IF NOT EXISTS upload_content_cid_idx ON upload (content_cid);
CREATE INDEX IF NOT EXISTS upload_updated_at_idx ON upload (updated_at);
CREATE INDEX IF NOT EXISTS upload_user_id_idx ON upload (user_id);
Expand Down

0 comments on commit ebe9bd0

Please sign in to comment.