Skip to content

Commit

Permalink
aplicar o interest X discomfortZone no relearn [clzaefmpe000qx40lk6ct…
Browse files Browse the repository at this point in the history
…a88s]
  • Loading branch information
pauloendoh committed Aug 6, 2024
1 parent f038fea commit 39b806e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/entities/skillbase/Skill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export class Skill {
@Column({ nullable: true, type: "float" })
priority: number | null

@Column({ nullable: true, type: "float" })
discomfortZone: number | null

@Column({ default: false })
isPublic: boolean

Expand Down
28 changes: 28 additions & 0 deletions src/migrations/1722899892198-Migration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { MigrationInterface, QueryRunner } from "typeorm";

export class Migration1722899892198 implements MigrationInterface {
name = 'Migration1722899892198'

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "question" DROP CONSTRAINT "FK_960e423bd8c1f0d9913bc1c099e"`);
await queryRunner.query(`ALTER TABLE "question" DROP CONSTRAINT "FK_5b87d9d19127bd5d92026017a7b"`);
await queryRunner.query(`ALTER TABLE "skill" ADD "discomfortZone" double precision`);
await queryRunner.query(`CREATE SEQUENCE IF NOT EXISTS "question_id_seq" OWNED BY "question"."id"`);
await queryRunner.query(`ALTER TABLE "question" ALTER COLUMN "id" SET DEFAULT nextval('"question_id_seq"')`);
await queryRunner.query(`ALTER TABLE "question" ALTER COLUMN "id" DROP DEFAULT`);
await queryRunner.query(`ALTER TABLE "question" ADD CONSTRAINT "FK_80f29cc01d0bd1644e389cc13be" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "question" ADD CONSTRAINT "FK_70f9da8788aa253b76bb919c872" FOREIGN KEY ("docId") REFERENCES "doc"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "question" DROP CONSTRAINT "FK_70f9da8788aa253b76bb919c872"`);
await queryRunner.query(`ALTER TABLE "question" DROP CONSTRAINT "FK_80f29cc01d0bd1644e389cc13be"`);
await queryRunner.query(`ALTER TABLE "question" ALTER COLUMN "id" SET DEFAULT nextval('note_id_seq')`);
await queryRunner.query(`ALTER TABLE "question" ALTER COLUMN "id" DROP DEFAULT`);
await queryRunner.query(`DROP SEQUENCE "question_id_seq"`);
await queryRunner.query(`ALTER TABLE "skill" DROP COLUMN "discomfortZone"`);
await queryRunner.query(`ALTER TABLE "question" ADD CONSTRAINT "FK_5b87d9d19127bd5d92026017a7b" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "question" ADD CONSTRAINT "FK_960e423bd8c1f0d9913bc1c099e" FOREIGN KEY ("docId") REFERENCES "doc"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
}

}

0 comments on commit 39b806e

Please sign in to comment.