@devx-commerce/plugin-product-reviews
Version:
Product Reviews Plugin for Medusa
20 lines • 2.49 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Migration20250428134029 = void 0;
const migrations_1 = require("@mikro-orm/migrations");
class Migration20250428134029 extends migrations_1.Migration {
async up() {
this.addSql(`drop index if exists "IDX_product_review_product_id";`);
this.addSql(`drop index if exists "IDX_product_review_customer_id";`);
this.addSql(`drop index if exists "IDX_product_review_verified_order_item_id";`);
this.addSql(`alter table if exists "product_review" drop column if exists "customer_id", drop column if exists "product_id", drop column if exists "verified_order_item_id", drop column if exists "verified_order_line_item_id";`);
}
async down() {
this.addSql(`alter table if exists "product_review" add column if not exists "customer_id" text null, add column if not exists "product_id" text null, add column if not exists "verified_order_item_id" text null, add column if not exists "verified_order_line_item_id" text null;`);
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_product_review_product_id" ON "product_review" (product_id) WHERE deleted_at IS NULL;`);
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_product_review_customer_id" ON "product_review" (customer_id) WHERE deleted_at IS NULL;`);
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_product_review_verified_order_item_id" ON "product_review" (verified_order_item_id) WHERE deleted_at IS NULL;`);
}
}
exports.Migration20250428134029 = Migration20250428134029;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTA0MjgxMzQwMjkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9wcm9kdWN0LXJldmlldy9taWdyYXRpb25zL01pZ3JhdGlvbjIwMjUwNDI4MTM0MDI5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHNEQUFrRDtBQUVsRCxNQUFhLHVCQUF3QixTQUFRLHNCQUFTO0lBRTNDLEtBQUssQ0FBQyxFQUFFO1FBQ2YsSUFBSSxDQUFDLE1BQU0sQ0FBQyx1REFBdUQsQ0FBQyxDQUFDO1FBQ3JFLElBQUksQ0FBQyxNQUFNLENBQUMsd0RBQXdELENBQUMsQ0FBQztRQUN0RSxJQUFJLENBQUMsTUFBTSxDQUFDLG1FQUFtRSxDQUFDLENBQUM7UUFDakYsSUFBSSxDQUFDLE1BQU0sQ0FBQyxzTkFBc04sQ0FBQyxDQUFDO0lBQ3RPLENBQUM7SUFFUSxLQUFLLENBQUMsSUFBSTtRQUNqQixJQUFJLENBQUMsTUFBTSxDQUFDLDBRQUEwUSxDQUFDLENBQUM7UUFDeFIsSUFBSSxDQUFDLE1BQU0sQ0FBQyx1SEFBdUgsQ0FBQyxDQUFDO1FBQ3JJLElBQUksQ0FBQyxNQUFNLENBQUMseUhBQXlILENBQUMsQ0FBQztRQUN2SSxJQUFJLENBQUMsTUFBTSxDQUFDLCtJQUErSSxDQUFDLENBQUM7SUFDL0osQ0FBQztDQUVGO0FBaEJELDBEQWdCQyJ9