templete campain
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';
|
||||
|
||||
/**
|
||||
* Discount is chosen by the salon at send time, not fixed per admin
|
||||
* template — so these columns live only on campaign_runs, as a snapshot of
|
||||
* what was actually used for that specific send.
|
||||
*/
|
||||
export class AddCampaignTemplateDiscount1722400000000
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'AddCampaignTemplateDiscount1722400000000';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.addColumns('campaign_runs', [
|
||||
new TableColumn({
|
||||
name: 'discountPercent',
|
||||
type: 'int',
|
||||
isNullable: true,
|
||||
}),
|
||||
new TableColumn({
|
||||
name: 'discountAmount',
|
||||
type: 'decimal',
|
||||
precision: 14,
|
||||
scale: 2,
|
||||
isNullable: true,
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.dropColumn('campaign_runs', 'discountAmount');
|
||||
await queryRunner.dropColumn('campaign_runs', 'discountPercent');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user