rust_forum/migrations/20241204225143_create_post_table.up.sql

8 lines
261 B
MySQL
Raw Normal View History

2024-12-04 23:17:19 +03:00
-- Add up migration script here
2024-12-05 01:57:47 +03:00
CREATE TABLE IF NOT EXISTS "post"(
2025-01-28 22:38:14 +03:00
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
);