fix: Add missing migration for payment statuses (#12821)

This commit is contained in:
Stevche Radevski
2025-06-25 11:28:33 +02:00
committed by GitHub
parent 91f6cfad5d
commit 95c3f4933a
2 changed files with 18 additions and 0 deletions

View File

@@ -211,6 +211,7 @@
"partially_authorized",
"canceled",
"failed",
"partially_captured",
"completed"
],
"mappedType": "enum"

View File

@@ -0,0 +1,17 @@
import { Migration } from '@mikro-orm/migrations';
export class Migration20250625084134 extends Migration {
override async up(): Promise<void> {
this.addSql(`alter table if exists "payment_collection" drop constraint if exists "payment_collection_status_check";`);
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'));`);
}
override async down(): Promise<void> {
this.addSql(`alter table if exists "payment_collection" drop constraint if exists "payment_collection_status_check";`);
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'));`);
}
}