1
0
mirror of https://github.com/civsocit/olgram.git synced 2025-12-16 23:36:17 +00:00
Files
olgram/olgram/migrations/models/12_20220329215535_update.sql
2022-03-29 22:36:50 +03:00

11 lines
362 B
SQL

-- upgrade --
CREATE TABLE IF NOT EXISTS "promo" (
"id" BIGSERIAL NOT NULL PRIMARY KEY,
"code" UUID NOT NULL,
"date" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
"owner_id" INT REFERENCES "user" ("id") ON DELETE SET NULL
);
CREATE INDEX IF NOT EXISTS "idx_promo_code_9b981a" ON "promo" ("code");
-- downgrade --
DROP TABLE IF EXISTS "promo";