rust_forum/migrations/20241204225143_create_post_table.up.sql
2025-01-27 17:54:57 +03:00

7 lines
270 B
SQL

-- Add up migration script here
CREATE TABLE IF NOT EXISTS "post"(
user_id BIGSERIAL NOT NULL REFERENCES "user"(user_id),
creation_time TIMESTAMPTZ UNIQUE NOT NULL DEFAULT NOW(),
post VARCHAR(8192) NOT NULL UNIQUE,
PRIMARY KEY(user_id, creation_time)
);