fix(medusa): Broken payment session migration (#3098)
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/medusa": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(medusa): Fix broken migration in the case of fresh installations
|
||||||
@@ -4,7 +4,8 @@ export class uniquePaySessCartId1673550502785 implements MigrationInterface {
|
|||||||
name = 'uniquePaySessCartId1673550502785'
|
name = 'uniquePaySessCartId1673550502785'
|
||||||
|
|
||||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
await queryRunner.query(`DROP INDEX "public"."UniqPaymentSessionCartIdProviderId"`);
|
await queryRunner.query(`DROP INDEX IF EXISTS "public"."UniqPaymentSessionCartIdProviderId"`);
|
||||||
|
await queryRunner.query(`DROP INDEX IF EXISTS "UniqPaymentSessionCartIdProviderId"`);
|
||||||
await queryRunner.query(`CREATE UNIQUE INDEX "UniqPaymentSessionCartIdProviderId" ON "payment_session" ("cart_id", "provider_id") WHERE cart_id IS NOT NULL`);
|
await queryRunner.query(`CREATE UNIQUE INDEX "UniqPaymentSessionCartIdProviderId" ON "payment_session" ("cart_id", "provider_id") WHERE cart_id IS NOT NULL`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user