|
1
|
import { Migration } from "@medusajs/framework/mikro-orm/migrations"; |
|
2
|
|
|
3
|
export class Migration20250520081315 extends Migration { |
|
4
|
override async up(): Promise<void> { |
|
5
|
this.addSql( |
|
6
|
`alter table if exists "store_credit_account" add column "code" text;` |
|
7
|
); |
|
8
|
this.addSql( |
|
9
|
`create unique index if not exists "IDX_store_credit_account_code_unique" on "store_credit_account" (code) where deleted_at is null;` |
|
10
|
); |
|
11
|
} |
|
12
|
|
|
13
|
override async down(): Promise<void> { |
|
14
|
this.addSql( |
|
15
|
`alter table if exists "store_credit_account" drop column "code";` |
|
16
|
); |
|
17
|
this.addSql(`drop index if exists "IDX_store_credit_account_code_unique";`); |
|
18
|
} |
|
19
|
} |