diff options
| author | Alexander Kavon <me+git@alexkavon.com> | 2024-01-25 02:47:26 -0500 |
|---|---|---|
| committer | Alexander Kavon <me+git@alexkavon.com> | 2024-01-25 02:47:26 -0500 |
| commit | 60eb2e7fe5ed3627ad4bd40286df1741529da75b (patch) | |
| tree | f18d8bbbc3590183333778a4e96bebff187366b2 /migrations/005_create_comments_tables.sql | |
| parent | 60fd8a68ed87cd7352b490e88ceff3ec21855937 (diff) | |
update hooks to more identifiable names, update migrations to work with votes, use a common enum state typeHEADtrunk
Diffstat (limited to 'migrations/005_create_comments_tables.sql')
| -rw-r--r-- | migrations/005_create_comments_tables.sql | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/migrations/005_create_comments_tables.sql b/migrations/005_create_comments_tables.sql index 3717c0c..8abf274 100644 --- a/migrations/005_create_comments_tables.sql +++ b/migrations/005_create_comments_tables.sql @@ -1,12 +1,10 @@ -CREATE TYPE comment_state AS ENUM ('hidden', 'visible'); - CREATE TABLE comments( id SERIAL NOT NULL PRIMARY KEY, comment TEXT NOT NULL, user_id INT NOT NULL REFERENCES users(id), post_id INT NOT NULL REFERENCES posts(id) ON DELETE CASCADE, reply_id INT REFERENCES comments(id) ON DELETE CASCADE, - state comment_state DEFAULT 'visible', + state postable_state DEFAULT 'visible', created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() ); @@ -19,4 +17,3 @@ EXECUTE PROCEDURE trigger_set_timestamp(); ---- create above / drop below ---- DROP TABLE comments; -DROP TYPE comment_state; |
