From b48b3dc0271c23d65ba677ca0f3c415e78c77040 Mon Sep 17 00:00:00 2001 From: liquidrinu Date: Thu, 15 May 2025 19:11:15 +0200 Subject: [PATCH] add missign migration --- .../migrations/Migration20240515170000.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/database/migrations/Migration20240515170000.ts diff --git a/src/database/migrations/Migration20240515170000.ts b/src/database/migrations/Migration20240515170000.ts new file mode 100644 index 0000000..5c9f896 --- /dev/null +++ b/src/database/migrations/Migration20240515170000.ts @@ -0,0 +1,20 @@ +import { Migration } from '@mikro-orm/migrations'; + +export class Migration20240515170000 extends Migration { + async up(): Promise { + this.addSql(` + CREATE TABLE IF NOT EXISTS "canvas_api_endpoints" ( + "id" serial PRIMARY KEY, + "created_at" timestamptz(0) NOT NULL DEFAULT now(), + "updated_at" timestamptz(0) NOT NULL DEFAULT now(), + "name" varchar(255) NOT NULL, + "method" varchar(255) NOT NULL, + "path" varchar(255) NOT NULL, + "description" varchar(255), + "user_id" int, + "public_path" varchar(255), + CONSTRAINT "canvas_api_endpoints_user_id_foreign" FOREIGN KEY ("user_id") REFERENCES "user" ("id") ON UPDATE CASCADE ON DELETE SET NULL + ); + `); + } +} \ No newline at end of file