18 lines
758 B
TypeScript
18 lines
758 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class RemovePriceUnitProductCol1779721786152 implements MigrationInterface {
|
|
name = 'RemovePriceUnitProductCol1779721786152';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`ALTER TABLE "products" DROP COLUMN "priceUnit"`);
|
|
await queryRunner.query(`DROP TYPE "public"."products_priceunit_enum"`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`CREATE TYPE "public"."products_priceunit_enum" AS ENUM('USD')`);
|
|
await queryRunner.query(
|
|
`ALTER TABLE "products" ADD "priceUnit" "public"."products_priceunit_enum" NOT NULL DEFAULT 'USD'`
|
|
);
|
|
}
|
|
}
|