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