fix(SPG-756) Untuk value field sales margin (%) seharusnya bisa mempunyai value dibelakang koma

fix/data
Aswin Ashar Abdullah 2024-08-02 15:28:56 +07:00
parent e401a1bf4c
commit 0e47b99ca7
2 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1,17 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
export class UpdateTypeColumnItemTable1722587128195
implements MigrationInterface
{
name = 'UpdateTypeColumnItemTable1722587128195';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "items" DROP COLUMN "sales_margin"`);
await queryRunner.query(`ALTER TABLE "items" ADD "sales_margin" numeric`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "items" DROP COLUMN "sales_margin"`);
await queryRunner.query(`ALTER TABLE "items" ADD "sales_margin" integer`);
}
}

View File

@ -38,7 +38,7 @@ export class ItemModel
@Column('bigint', { name: 'hpp', nullable: true }) @Column('bigint', { name: 'hpp', nullable: true })
hpp: number; hpp: number;
@Column('int', { name: 'sales_margin', nullable: true }) @Column('decimal', { name: 'sales_margin', nullable: true })
sales_margin: number; sales_margin: number;
@Column('bigint', { name: 'total_price', nullable: true }) @Column('bigint', { name: 'total_price', nullable: true })