Files
stash-box/pkg/database/migrations/postgres/24_drafts.up.sql
2022-01-18 23:26:31 +01:00

9 lines
282 B
SQL

CREATE TABLE "drafts" (
"id" UUID PRIMARY KEY,
"user_id" UUID NOT NULL,
"type" TEXT CHECK ("type" in ('SCENE', 'PERFORMER', 'STUDIO')) NOT NULL,
"data" JSONB NOT NULL,
"created_at" TIMESTAMP NOT NULL,
FOREIGN KEY("user_id") REFERENCES "users"("id") ON DELETE CASCADE
);