rust_forum/migrations/20241204230240_create_post_interaction_table.up.sql

7 lines
356 B
MySQL
Raw Normal View History

2024-12-05 02:21:20 +03:00
-- Add up migration script here
CREATE TABLE IF NOT EXISTS "post_interaction"(
interaction_time TIMESTAMPTZ PRIMARY KEY NOT NULL UNIQUE DEFAULT NOW(),
2024-12-05 02:21:20 +03:00
post_creation_time TIMESTAMPTZ NOT NULL REFERENCES "post"(creation_time),
2024-12-15 04:30:39 +03:00
user_id BIGSERIAL NOT NULL REFERENCES "user"(id),
interaction_id BIGSERIAL NOT NULL REFERENCES "interaction"(id)
);