@devx-commerce/plugin-gati
Version:
Gati ERP integration for Medusa
23 lines • 5.93 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Migration20250601030519 = void 0;
const migrations_1 = require("@mikro-orm/migrations");
class Migration20250601030519 extends migrations_1.Migration {
async up() {
this.addSql(`create table if not exists "style_collection_line" ("id" text not null, "style_id" integer not null, "desg_no" integer not null, "collection_name" text not null, "collection_group_no" integer not null, "collection_group_name" text not null, "collection_group_code" text not null, "extended_product_id" text not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "style_collection_line_pkey" primary key ("id"));`);
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_style_collection_line_extended_product_id" ON "style_collection_line" (extended_product_id) WHERE deleted_at IS NULL;`);
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_style_collection_line_deleted_at" ON "style_collection_line" (deleted_at) WHERE deleted_at IS NULL;`);
this.addSql(`alter table if exists "style_collection_line" add constraint "style_collection_line_extended_product_id_foreign" foreign key ("extended_product_id") references "extended_product" ("id") on update cascade;`);
this.addSql(`alter table if exists "extended_product" add column if not exists "grp_group_no" integer not null, add column if not exists "category_group_name" text not null, add column if not exists "category_group_code" text not null, add column if not exists "grp_no" integer not null, add column if not exists "category_code" text not null, add column if not exists "sub_itm_no" integer not null, add column if not exists "sub_category_code" text not null, add column if not exists "make_type_no" integer not null, add column if not exists "make_type_code" text not null, add column if not exists "stock_type_no" integer not null, add column if not exists "stock_type_code" text not null, add column if not exists "item_size_id" integer not null, add column if not exists "item_size_name" text not null, add column if not exists "brand_no" integer not null, add column if not exists "brand_name" text not null, add column if not exists "gender_no" integer not null, add column if not exists "gender_name" text not null;`);
this.addSql(`alter table if exists "style_details_line" add column if not exists "item_id" integer not null, add column if not exists "item_name" text not null, add column if not exists "raw_no" integer not null, add column if not exists "shape_no" integer not null, add column if not exists "qly_no" integer not null, add column if not exists "tone_no" integer not null, add column if not exists "size_no" integer not null, add column if not exists "size_name" text not null, add column if not exists "accessories_id" integer not null, add column if not exists "accessories_name" text not null, add column if not exists "setting_name" text not null, add column if not exists "smd_set_no" integer not null;`);
this.addSql(`alter table if exists "style_exploration_line" add column if not exists "exploration_id" integer not null, add column if not exists "exploration_name" text not null;`);
}
async down() {
this.addSql(`drop table if exists "style_collection_line" cascade;`);
this.addSql(`alter table if exists "extended_product" drop column if exists "grp_group_no", drop column if exists "category_group_name", drop column if exists "category_group_code", drop column if exists "grp_no", drop column if exists "category_code", drop column if exists "sub_itm_no", drop column if exists "sub_category_code", drop column if exists "make_type_no", drop column if exists "make_type_code", drop column if exists "stock_type_no", drop column if exists "stock_type_code", drop column if exists "item_size_id", drop column if exists "item_size_name", drop column if exists "brand_no", drop column if exists "brand_name", drop column if exists "gender_no", drop column if exists "gender_name";`);
this.addSql(`alter table if exists "style_details_line" drop column if exists "item_id", drop column if exists "item_name", drop column if exists "raw_no", drop column if exists "shape_no", drop column if exists "qly_no", drop column if exists "tone_no", drop column if exists "size_no", drop column if exists "size_name", drop column if exists "accessories_id", drop column if exists "accessories_name", drop column if exists "setting_name", drop column if exists "smd_set_no";`);
this.addSql(`alter table if exists "style_exploration_line" drop column if exists "exploration_id", drop column if exists "exploration_name";`);
}
}
exports.Migration20250601030519 = Migration20250601030519;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTA2MDEwMzA1MTkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9leHRlbmRlZC1wcm9kdWN0L21pZ3JhdGlvbnMvTWlncmF0aW9uMjAyNTA2MDEwMzA1MTkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsc0RBQWtEO0FBRWxELE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFFM0MsS0FBSyxDQUFDLEVBQUU7UUFDZixJQUFJL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