|
1
|
import { Migration } from "@medusajs/framework/mikro-orm/migrations" |
|
2
|
|
|
3
|
export class Migration20241129124827 extends Migration { |
|
4
|
async up(): Promise<void> { |
|
5
|
this.addSql( |
|
6
|
'alter table if exists "order_address" add column if not exists "deleted_at" timestamptz null;' |
|
7
|
) |
|
8
|
this.addSql( |
|
9
|
'CREATE INDEX IF NOT EXISTS "IDX_order_address_deleted_at" ON "order_address" (deleted_at) WHERE deleted_at IS NULL;' |
|
10
|
) |
|
11
|
} |
|
12
|
|
|
13
|
async down(): Promise<void> { |
|
14
|
this.addSql(` |
|
15
|
ALTER TABLE "order_address" DROP COLUMN if exists "deleted_at"; |
|
16
|
`) |
|
17
|
} |
|
18
|
} |