-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"`); | ||
} | ||
} |