|
1
|
import { Migration } from "@medusajs/framework/mikro-orm/migrations" |
|
2
|
|
|
3
|
export class Migration20241202100304 extends Migration { |
|
4
|
async up(): Promise<void> { |
|
5
|
this.addSql( |
|
6
|
'alter table if exists "auth_identity" add column if not exists "deleted_at" timestamptz null;' |
|
7
|
) |
|
8
|
this.addSql( |
|
9
|
'CREATE INDEX IF NOT EXISTS "IDX_auth_identity_deleted_at" ON "auth_identity" (deleted_at) WHERE deleted_at IS NULL;' |
|
10
|
) |
|
11
|
|
|
12
|
this.addSql( |
|
13
|
'alter table if exists "provider_identity" add column if not exists "deleted_at" timestamptz null;' |
|
14
|
) |
|
15
|
this.addSql( |
|
16
|
'CREATE INDEX IF NOT EXISTS "IDX_provider_identity_deleted_at" ON "provider_identity" (deleted_at) WHERE deleted_at IS NULL;' |
|
17
|
) |
|
18
|
} |
|
19
|
|
|
20
|
async down(): Promise<void> { |
|
21
|
this.addSql('drop index if exists "IDX_auth_identity_deleted_at";') |
|
22
|
this.addSql( |
|
23
|
'alter table if exists "auth_identity" drop column if exists "deleted_at";' |
|
24
|
) |
|
25
|
|
|
26
|
this.addSql('drop index if exists "IDX_provider_identity_deleted_at";') |
|
27
|
this.addSql( |
|
28
|
'alter table if exists "provider_identity" drop column if exists "deleted_at";' |
|
29
|
) |
|
30
|
} |
|
31
|
} |