Skip to content

Commit

Permalink
[DEV-3493] add migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick1712 committed Dec 30, 2024
1 parent 3117d30 commit 406f301
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions migration/1735574957300-addUserDataTransaction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { MigrationInterface, QueryRunner } = require("typeorm");

module.exports = class addUserDataTransaction1735574957300 {
name = 'addUserDataTransaction1735574957300'

async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "dbo"."transaction" ADD "userDataId" int`);
await queryRunner.query(`ALTER TABLE "dbo"."transaction" ADD CONSTRAINT "FK_1e5036f71c59cd6e514280f2719" FOREIGN KEY ("userDataId") REFERENCES "user_data"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
}

async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "dbo"."transaction" DROP CONSTRAINT "FK_1e5036f71c59cd6e514280f2719"`);
await queryRunner.query(`ALTER TABLE "dbo"."transaction" DROP COLUMN "userDataId"`);
}
}

0 comments on commit 406f301

Please sign in to comment.