Raw
1 import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
3 export class Migration20250207132723 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', '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'));`);
15 }
16
17 }