pos-be/src/database/migrations/1718675739425-update-column...

20 lines
676 B
TypeScript

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'`,
);
}
}