fix(SPG-525) BE-Form Tax-Value Tax bisa koma - float

pull/2/head
ashar 2024-06-18 09:01:12 +07:00
parent 84e65d2599
commit af6266c8d6
2 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateColumnTax1718675739425 implements MigrationInterface {
name = 'UpdateColumnTax1718675739425'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "taxes" DROP COLUMN "value"`);
await queryRunner.query(`ALTER TABLE "taxes" ADD "value" double precision NOT NULL DEFAULT '0'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "taxes" DROP COLUMN "value"`);
await queryRunner.query(`ALTER TABLE "taxes" ADD "value" integer NOT NULL DEFAULT '0'`);
}
}

View File

@ -8,6 +8,6 @@ export class TaxModel extends BaseStatusModel<TaxEntity> implements TaxEntity {
@Column('varchar', { name: 'name' }) @Column('varchar', { name: 'name' })
name: string; name: string;
@Column('int', { name: 'value', default: 0 }) @Column('float', { name: 'value', default: 0 })
value: number; value: number;
} }