rust_forum/migrations/20241204225151_create_comment_table.up.sql

8 lines
318 B
MySQL
Raw Normal View History

2024-12-05 01:57:47 +03:00
-- Add up migration script here
CREATE TABLE IF NOT EXISTS "comment"(
creation_time TIMESTAMPTZ PRIMARY KEY NOT NULL UNIQUE DEFAULT NOW(),
2024-12-15 20:56:24 +03:00
post_creation_time TIMESTAMPTZ NOT NULL REFERENCES "post"(creation_time),
user_id BIGSERIAL NOT NULL REFERENCES "user"(user_id),
comment VARCHAR(8192) NOT NULL
);