migrate
This commit is contained in:
parent
225063e8b7
commit
7a4b25079f
1 changed files with 22 additions and 0 deletions
22
src/migration/1718173589821-update_table_role_add_sys.ts
Normal file
22
src/migration/1718173589821-update_table_role_add_sys.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class UpdateTableRoleAddSys1718173589821 implements MigrationInterface {
|
||||
name = 'UpdateTableRoleAddSys1718173589821'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`DROP INDEX \`FK_b5b59c60792d518f4f025379dba\` ON \`authRoleAttr\``);
|
||||
await queryRunner.query(`ALTER TABLE \`authSys\` ADD \`parentId\` varchar(255) NULL COMMENT 'Id ของเมนูหลักถ้าเป็นเมนูหลักจะเป็นค่า null'`);
|
||||
await queryRunner.query(`ALTER TABLE \`authSys\` ADD \`icon\` varchar(100) NULL COMMENT 'ชื่อ icon'`);
|
||||
await queryRunner.query(`ALTER TABLE \`authSys\` ADD \`path\` varchar(255) NULL COMMENT 'path url ของระบบ'`);
|
||||
await queryRunner.query(`ALTER TABLE \`authSys\` ADD \`order\` int NOT NULL COMMENT 'ลำดับการแสดงผล' DEFAULT '0'`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`authSys\` DROP COLUMN \`order\``);
|
||||
await queryRunner.query(`ALTER TABLE \`authSys\` DROP COLUMN \`path\``);
|
||||
await queryRunner.query(`ALTER TABLE \`authSys\` DROP COLUMN \`icon\``);
|
||||
await queryRunner.query(`ALTER TABLE \`authSys\` DROP COLUMN \`parentId\``);
|
||||
await queryRunner.query(`CREATE INDEX \`FK_b5b59c60792d518f4f025379dba\` ON \`authRoleAttr\` (\`authSysId\`)`);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue