diff --git a/src/entities/Registry.ts b/src/entities/Registry.ts index 95a4d63e..402b6e29 100644 --- a/src/entities/Registry.ts +++ b/src/entities/Registry.ts @@ -256,10 +256,10 @@ export class Registry extends EntityBase { birthdate: Date; @Column({ + type: "text", nullable: true, comment: "วุฒิการศึกษา", - length: 255, - default: null, + default: null }) degrees: string; @@ -350,18 +350,18 @@ export class Registry extends EntityBase { Educations: string; @Column({ + type: "text", nullable: true, comment: "ระดับศึกษา", - length: 255, - default: null, + default: null }) educationLevels: string; @Column({ + type: "text", nullable: true, comment: "สาขาวิชา/ทาง", - length: 255, - default: null, + default: null }) fields: string; } diff --git a/src/entities/RegistryEmployee.ts b/src/entities/RegistryEmployee.ts index 31d0a8b2..09c4815f 100644 --- a/src/entities/RegistryEmployee.ts +++ b/src/entities/RegistryEmployee.ts @@ -248,9 +248,9 @@ export class RegistryEmployee extends EntityBase { birthdate: Date; @Column({ + type: "text", nullable: true, comment: "วุฒิการศึกษา", - length: 255, default: null, }) degrees: string; @@ -313,18 +313,18 @@ export class RegistryEmployee extends EntityBase { Educations: string; @Column({ + type: "text", nullable: true, comment: "ระดับศึกษา", - length: 255, - default: null, + default: null }) educationLevels: string; @Column({ + type: "text", nullable: true, comment: "สาขาวิชา/ทาง", - length: 255, - default: null, + default: null }) fields: string; diff --git a/src/migration/1757484721787-update_dataType_fields_registry_and_registryEmpployee.ts b/src/migration/1757484721787-update_dataType_fields_registry_and_registryEmpployee.ts new file mode 100644 index 00000000..25ea2cb7 --- /dev/null +++ b/src/migration/1757484721787-update_dataType_fields_registry_and_registryEmpployee.ts @@ -0,0 +1,36 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateDataTypeFieldsRegistryAndRegistryEmpployee1757484721787 implements MigrationInterface { + name = 'UpdateDataTypeFieldsRegistryAndRegistryEmpployee1757484721787' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`registry\` DROP COLUMN \`degrees\``); + await queryRunner.query(`ALTER TABLE \`registry\` ADD \`degrees\` text NULL COMMENT 'วุฒิการศึกษา'`); + await queryRunner.query(`ALTER TABLE \`registry\` DROP COLUMN \`educationLevels\``); + await queryRunner.query(`ALTER TABLE \`registry\` ADD \`educationLevels\` text NULL COMMENT 'ระดับศึกษา'`); + await queryRunner.query(`ALTER TABLE \`registry\` DROP COLUMN \`fields\``); + await queryRunner.query(`ALTER TABLE \`registry\` ADD \`fields\` text NULL COMMENT 'สาขาวิชา/ทาง'`); + await queryRunner.query(`ALTER TABLE \`registryEmployee\` DROP COLUMN \`degrees\``); + await queryRunner.query(`ALTER TABLE \`registryEmployee\` ADD \`degrees\` text NULL COMMENT 'วุฒิการศึกษา'`); + await queryRunner.query(`ALTER TABLE \`registryEmployee\` DROP COLUMN \`educationLevels\``); + await queryRunner.query(`ALTER TABLE \`registryEmployee\` ADD \`educationLevels\` text NULL COMMENT 'ระดับศึกษา'`); + await queryRunner.query(`ALTER TABLE \`registryEmployee\` DROP COLUMN \`fields\``); + await queryRunner.query(`ALTER TABLE \`registryEmployee\` ADD \`fields\` text NULL COMMENT 'สาขาวิชา/ทาง'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`registryEmployee\` DROP COLUMN \`fields\``); + await queryRunner.query(`ALTER TABLE \`registryEmployee\` ADD \`fields\` varchar(255) NULL COMMENT 'สาขาวิชา/ทาง'`); + await queryRunner.query(`ALTER TABLE \`registryEmployee\` DROP COLUMN \`educationLevels\``); + await queryRunner.query(`ALTER TABLE \`registryEmployee\` ADD \`educationLevels\` varchar(255) NULL COMMENT 'ระดับศึกษา'`); + await queryRunner.query(`ALTER TABLE \`registryEmployee\` DROP COLUMN \`degrees\``); + await queryRunner.query(`ALTER TABLE \`registryEmployee\` ADD \`degrees\` varchar(255) NULL COMMENT 'วุฒิการศึกษา'`); + await queryRunner.query(`ALTER TABLE \`registry\` DROP COLUMN \`fields\``); + await queryRunner.query(`ALTER TABLE \`registry\` ADD \`fields\` varchar(255) NULL COMMENT 'สาขาวิชา/ทาง'`); + await queryRunner.query(`ALTER TABLE \`registry\` DROP COLUMN \`educationLevels\``); + await queryRunner.query(`ALTER TABLE \`registry\` ADD \`educationLevels\` varchar(255) NULL COMMENT 'ระดับศึกษา'`); + await queryRunner.query(`ALTER TABLE \`registry\` DROP COLUMN \`degrees\``); + await queryRunner.query(`ALTER TABLE \`registry\` ADD \`degrees\` varchar(255) NULL COMMENT 'วุฒิการศึกษา'`); + } + +}