diff options
Diffstat (limited to 'migrations/006_create_votes_table.sql')
| -rw-r--r-- | migrations/006_create_votes_table.sql | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/migrations/006_create_votes_table.sql b/migrations/006_create_votes_table.sql index 8ed4c5f..ac73918 100644 --- a/migrations/006_create_votes_table.sql +++ b/migrations/006_create_votes_table.sql @@ -6,7 +6,7 @@ CREATE TABLE votes ( inc INT NOT NULL CHECK (inc in (-1, 1)), created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), - CONSTRAINT vote_pkey UNIQUE NULLS NOT DISTINCT (post_id, comment_id, user_id), + CONSTRAINT post_comment_user_pkey UNIQUE NULLS NOT DISTINCT (post_id, comment_id, user_id), CHECK ((post_id IS NOT NULL AND comment_id IS NULL) OR (comment_id IS NOT NULL AND post_id IS NULL)) ); |
