diff --git a/devU-api/src/migration/1626719306608-addAssignmentsAndCourses.ts b/devU-api/src/migration/1626719306608-addAssignmentsAndCourses.ts index 332ac2a..f761ab3 100644 --- a/devU-api/src/migration/1626719306608-addAssignmentsAndCourses.ts +++ b/devU-api/src/migration/1626719306608-addAssignmentsAndCourses.ts @@ -15,8 +15,6 @@ export class addAssignmentsAndCourses1626719306608 implements MigrationInterface "created_at" TIMESTAMP NOT NULL DEFAULT now(), "updated_at" TIMESTAMP NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP, - "is_public" boolean NOT NULL DEFAULT false, - "private_data" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "courses_primary_key_constraint" PRIMARY KEY ("id") )` ) diff --git a/devU-api/src/migration/1730867565396-publicCourses.ts b/devU-api/src/migration/1730867565396-publicCourses.ts new file mode 100644 index 0000000..029ff8c --- /dev/null +++ b/devU-api/src/migration/1730867565396-publicCourses.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class Migration1730867565396 implements MigrationInterface { + name = 'Migration1730867565396' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "courses" ADD "is_public" boolean NOT NULL DEFAULT false`); + await queryRunner.query(`ALTER TABLE "courses" ADD "private_data" TIMESTAMP NOT NULL DEFAULT now()`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "courses" DROP COLUMN "private_data"`); + await queryRunner.query(`ALTER TABLE "courses" DROP COLUMN "is_public"`); + } + +}