howmuch/migrations/20241019112255_create_expense_table.postgres.up.sql
Muyao CHEN 3d616bff50
All checks were successful
Build and test / Build (push) Successful in 2m23s
db: finish sql commands
2024-10-19 17:08:05 +02:00

15 lines
426 B
SQL

CREATE TABLE "expense" (
"id" serial NOT NULL,
PRIMARY KEY ("id"),
"created_at" date NOT NULL,
"updated_at" date NOT NULL,
"amount" integer NOT NULL,
"currency" character varying NOT NULL,
"event_id" integer NOT NULL,
"name" character varying(255) NULL,
"place" character varying(1000) NULL
);
ALTER TABLE "expense"
ADD FOREIGN KEY ("event_id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE