rust_forum/migrations/20241204225143_create_post_table.up.sql
2025-01-19 23:47:09 +03:00

6 lines
241 B
SQL

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