rust_forum/migrations/20241204225143_create_post_table.up.sql

7 lines
241 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"(
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
);