|
1
|
import { Migration } from "@medusajs/framework/mikro-orm/migrations" |
|
2
|
|
|
3
|
export class Migration20250917143818 extends Migration { |
|
4
|
override async up(): Promise<void> { |
|
5
|
this.addSql( |
|
6
|
`CREATE INDEX IF NOT EXISTS "IDX_promotion_is_automatic" ON "promotion" (is_automatic) WHERE deleted_at IS NULL;` |
|
7
|
) |
|
8
|
|
|
9
|
this.addSql( |
|
10
|
`CREATE INDEX IF NOT EXISTS "IDX_promotion_rule_value_rule_id_value" ON "promotion_rule_value" (promotion_rule_id, value) WHERE deleted_at IS NULL;` |
|
11
|
) |
|
12
|
this.addSql( |
|
13
|
`CREATE INDEX IF NOT EXISTS "IDX_promotion_rule_value_value" ON "promotion_rule_value" (value) WHERE deleted_at IS NULL;` |
|
14
|
) |
|
15
|
} |
|
16
|
|
|
17
|
override async down(): Promise<void> { |
|
18
|
this.addSql(`drop index if exists "IDX_promotion_is_automatic";`) |
|
19
|
|
|
20
|
this.addSql( |
|
21
|
`drop index if exists "IDX_promotion_rule_value_rule_id_value";` |
|
22
|
) |
|
23
|
this.addSql(`drop index if exists "IDX_promotion_rule_value_value";`) |
|
24
|
} |
|
25
|
} |