Skip to content

Commit

Permalink
adjust migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Janderson Souza Matias authored and Janderson Souza Matias committed Dec 18, 2023
1 parent 6b538b2 commit 3db005d
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/database/migrations/1702585603182-migrations.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import { MigrationInterface, QueryRunner } from "typeorm";

export class Migrations1702585603182 implements MigrationInterface {
name = 'Migrations1702585603182'
name = "Migrations1702585603182";

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "region" DROP COLUMN "nsleft"`);
await queryRunner.query(`ALTER TABLE "region" DROP COLUMN "nsright"`);
await queryRunner.query(`ALTER TABLE "region" ADD "mpath" character varying DEFAULT ''`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "region" DROP COLUMN "mpath"`);
await queryRunner.query(`ALTER TABLE "region" ADD "nsright" integer NOT NULL DEFAULT '2'`);
await queryRunner.query(`ALTER TABLE "region" ADD "nsleft" integer NOT NULL DEFAULT '1'`);
}
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "region" ADD "mpath" character varying DEFAULT ''`
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "region" DROP COLUMN "mpath"`);
}
}

0 comments on commit 3db005d

Please sign in to comment.