From 60eb2e7fe5ed3627ad4bd40286df1741529da75b Mon Sep 17 00:00:00 2001 From: Alexander Kavon Date: Thu, 25 Jan 2024 02:47:26 -0500 Subject: update hooks to more identifiable names, update migrations to work with votes, use a common enum state type --- migrations/006_create_votes_table.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'migrations/006_create_votes_table.sql') 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)) ); -- cgit v1.2.3