diff --git a/apps/backend/src/migrations/1771191788744-CreateDisciplineTable.ts b/apps/backend/src/migrations/1771191788744-CreateDisciplineTable.ts new file mode 100644 index 00000000..2366e69f --- /dev/null +++ b/apps/backend/src/migrations/1771191788744-CreateDisciplineTable.ts @@ -0,0 +1,27 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class CreateDisciplineTable1771191788744 implements MigrationInterface { + name = 'CreateDisciplineTable1771191788744'; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `CREATE TYPE "public"."discipline_name_enum" AS ENUM( + 'MD/Medical Student/Pre-Med', + 'Medical NP/PA', + 'Psychiatry or Psychiatric NP/PA', + 'Public Health', + 'RN', + 'Social Work', + 'Other' + )`, + ); + await queryRunner.query( + `CREATE TABLE "discipline" ("id" SERIAL NOT NULL, "name" "public"."discipline_name_enum" NOT NULL, "admin_ids" integer array NOT NULL DEFAULT '{}', CONSTRAINT "PK_139512aefbb11a5b2fa92696828" PRIMARY KEY ("id"))`, + ); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP TABLE "discipline"`); + await queryRunner.query(`DROP TYPE "public"."discipline_name_enum"`); + } +}