|
1
|
import { Migration } from "@medusajs/framework/mikro-orm/migrations" |
|
2
|
|
|
3
|
export class Migration20260306120000 extends Migration { |
|
4
|
override async up(): Promise<void> { |
|
5
|
this.addSql( |
|
6
|
`alter table if exists "product_tag" add column if not exists "external_id" text null;` |
|
7
|
) |
|
8
|
this.addSql( |
|
9
|
`alter table if exists "product_collection" add column if not exists "external_id" text null;` |
|
10
|
) |
|
11
|
this.addSql( |
|
12
|
`alter table if exists "product_type" add column if not exists "external_id" text null;` |
|
13
|
) |
|
14
|
} |
|
15
|
|
|
16
|
override async down(): Promise<void> { |
|
17
|
this.addSql( |
|
18
|
`alter table if exists "product_tag" drop column if exists "external_id";` |
|
19
|
) |
|
20
|
this.addSql( |
|
21
|
`alter table if exists "product_collection" drop column if exists "external_id";` |
|
22
|
) |
|
23
|
this.addSql( |
|
24
|
`alter table if exists "product_type" drop column if exists "external_id";` |
|
25
|
) |
|
26
|
} |
|
27
|
} |