Raw
1 import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
3 export class Migration20241106085918 extends Migration {
4
5 async up(): Promise<void> {
6 this.addSql('alter table if exists "cart_line_item" add column if not exists "product_type_id" text null;');
7 this.addSql('CREATE INDEX IF NOT EXISTS "IDX_line_item_product_type_id" ON "cart_line_item" (product_type_id) WHERE deleted_at IS NULL AND product_type_id IS NOT NULL;');
8 }
9
10 async down(): Promise<void> {
11 this.addSql('drop index if exists "IDX_line_item_product_type_id";');
12 this.addSql('alter table if exists "cart_line_item" drop column if exists "product_type_id";');
13 }
14
15 }