aboutsummaryrefslogtreecommitdiff
path: root/migrations/006_create_votes_table.sql
diff options
context:
space:
mode:
authorAlexander Kavon <me+git@alexkavon.com>2024-01-25 02:47:26 -0500
committerAlexander Kavon <me+git@alexkavon.com>2024-01-25 02:47:26 -0500
commit60eb2e7fe5ed3627ad4bd40286df1741529da75b (patch)
treef18d8bbbc3590183333778a4e96bebff187366b2 /migrations/006_create_votes_table.sql
parent60fd8a68ed87cd7352b490e88ceff3ec21855937 (diff)
update hooks to more identifiable names, update migrations to work with votes, use a common enum state typeHEADtrunk
Diffstat (limited to 'migrations/006_create_votes_table.sql')
-rw-r--r--migrations/006_create_votes_table.sql2
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))
);