Raw
1 import { Migration } from "@medusajs/framework/mikro-orm/migrations"
2
3 export class Migration20250704120229 extends Migration {
4 override async up(): Promise<void> {
5 this.addSql(
6 `alter table if exists "order_credit_line" drop constraint if exists "order_credit_line_order_id_foreign";`
7 )
8
9 this.addSql(
10 `alter table if exists "order_credit_line" add constraint "order_credit_line_order_id_foreign" foreign key ("order_id") references "order" ("id") on update cascade on delete cascade;`
11 )
12 }
13
14 override async down(): Promise<void> {
15 this.addSql(
16 `alter table if exists "order_credit_line" drop constraint if exists "order_credit_line_order_id_foreign";`
17 )
18
19 this.addSql(
20 `alter table if exists "order_credit_line" add constraint "order_credit_line_order_id_foreign" foreign key ("order_id") references "order" ("id") on update cascade;`
21 )
22 }
23 }