|
1
|
import { Migration } from "@medusajs/framework/mikro-orm/migrations" |
|
2
|
|
|
3
|
export class Migration20240205025928 extends Migration { |
|
4
|
async up(): Promise<void> { |
|
5
|
this.addSql( |
|
6
|
'create table if not exists "auth_identity" ("id" text not null, "entity_id" text not null, "provider" text not null, "user_metadata" jsonb null, "app_metadata" jsonb null, "provider_metadata" jsonb null, constraint "auth_identity_pkey" primary key ("id"));' |
|
7
|
) |
|
8
|
this.addSql( |
|
9
|
'alter table "auth_identity" drop constraint if exists "IDX_auth_identity_provider_entity_id"' |
|
10
|
) |
|
11
|
this.addSql( |
|
12
|
'alter table "auth_identity" add constraint "IDX_auth_identity_provider_entity_id" unique ("provider", "entity_id");' |
|
13
|
) |
|
14
|
|
|
15
|
this.addSql('alter table "auth_identity" drop column if exists "scope";') |
|
16
|
this.addSql( |
|
17
|
`alter table "auth_identity" alter column "app_metadata" drop not null;` |
|
18
|
) |
|
19
|
} |
|
20
|
|
|
21
|
async down(): Promise<void> { |
|
22
|
this.addSql('drop table if exists "auth_identity" cascade;') |
|
23
|
} |
|
24
|
} |