rust_forum/migrations/20241204230248_create_comment_interaction_table.up.sql
Ahmet Kaan GÜMÜŞ dc849dd970 feat: post routing
2024-12-15 04:30:39 +03:00

7 lines
No EOL
365 B
SQL

-- Add up migration script here
CREATE TABLE IF NOT EXISTS "comment_interaction"(
comment_creation_time TIMESTAMPTZ NOT NULL REFERENCES "comment"(creation_time),
user_id BIGSERIAL NOT NULL REFERENCES "user"(id),
interaction_id BIGSERIAL NOT NULL REFERENCES "interaction"(id),
interaction_time TIMESTAMPTZ PRIMARY KEY NOT NULL UNIQUE DEFAULT NOW()
);