Skip to content

Commit ee546dd

Browse files
committed
fix: Add missing migration for payment statuses
1 parent d517dbd commit ee546dd

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

packages/modules/payment/src/migrations/.snapshot-medusa-payment.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@
211211
"partially_authorized",
212212
"canceled",
213213
"failed",
214+
"partially_captured",
214215
"completed"
215216
],
216217
"mappedType": "enum"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Migration } from '@mikro-orm/migrations';
2+
3+
export class Migration20250625084134 extends Migration {
4+
5+
override async up(): Promise<void> {
6+
this.addSql(`alter table if exists "payment_collection" drop constraint if exists "payment_collection_status_check";`);
7+
8+
this.addSql(`alter table if exists "payment_collection" add constraint "payment_collection_status_check" check("status" in ('not_paid', 'awaiting', 'authorized', 'partially_authorized', 'canceled', 'failed', 'partially_captured', 'completed'));`);
9+
}
10+
11+
override async down(): Promise<void> {
12+
this.addSql(`alter table if exists "payment_collection" drop constraint if exists "payment_collection_status_check";`);
13+
14+
this.addSql(`alter table if exists "payment_collection" add constraint "payment_collection_status_check" check("status" in ('not_paid', 'awaiting', 'authorized', 'partially_authorized', 'canceled', 'failed', 'completed'));`);
15+
}
16+
17+
}

0 commit comments

Comments
 (0)