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

7 lines
261 B
SQL

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