26 lines
753 B
TypeScript
26 lines
753 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class UpdateColumnTransaction1721385120750
|
|
implements MigrationInterface
|
|
{
|
|
name = 'UpdateColumnTransaction1721385120750';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`ALTER TABLE "transactions" DROP COLUMN "discount_percentage"`,
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE "transactions" ADD "discount_percentage" numeric`,
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`ALTER TABLE "transactions" DROP COLUMN "discount_percentage"`,
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE "transactions" ADD "discount_percentage" integer`,
|
|
);
|
|
}
|
|
}
|