Skip to content

Commit ec11aea

Browse files
VayrasVayras
authored andcommitted
migration CI fix
1 parent 1b824f9 commit ec11aea

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

migrations/1761573105513-migrations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class Migrations1761573105513 implements MigrationInterface {
55

66
public async up(queryRunner: QueryRunner): Promise<void> {
77
await queryRunner.query(
8-
`CREATE TABLE "feedback" ("createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "id" uuid NOT NULL DEFAULT uuid_generate_v4(), "feedbackText" text NOT NULL, "userId" uuid NOT NULL, "cohortId" uuid NOT NULL, CONSTRAINT "UQ_feedback_user_cohort" UNIQUE ("userId", "cohortId"), CONSTRAINT "PK_8389f9e087a57689cd5be8b2b13" PRIMARY KEY ("id"))`,
8+
`CREATE TABLE "feedback" ("createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "id" uuid NOT NULL DEFAULT uuid_generate_v4(), "feedbackText" text NOT NULL, "userId" uuid NOT NULL, "cohortId" uuid NOT NULL, CONSTRAINT "PK_8389f9e087a57689cd5be8b2b13" PRIMARY KEY ("id"))`,
99
);
1010
await queryRunner.query(
1111
`ALTER TABLE "feedback" ADD CONSTRAINT "FK_4a39e6ac0cecdf18307a365cf3c" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { MigrationInterface, QueryRunner } from 'typeorm';
2+
3+
export class Migrations1762762100000 implements MigrationInterface {
4+
name = 'Migrations1762762100000';
5+
6+
public async up(queryRunner: QueryRunner): Promise<void> {
7+
await queryRunner.query(
8+
`ALTER TABLE "feedback" ADD CONSTRAINT "UQ_feedback_user_cohort" UNIQUE ("userId", "cohortId")`,
9+
);
10+
}
11+
12+
public async down(queryRunner: QueryRunner): Promise<void> {
13+
await queryRunner.query(
14+
`ALTER TABLE "feedback" DROP CONSTRAINT "UQ_feedback_user_cohort"`,
15+
);
16+
}
17+
}

0 commit comments

Comments
 (0)