rust_forum/migrations/20241204230248_create_comment_interaction_table.up.sql
2025-01-28 22:38:14 +03:00

8 lines
377 B
SQL

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