@devx-commerce/plugin-gati
Version:
Gati ERP integration for Medusa
27 lines • 7.73 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Migration20250507055941 = void 0;
const migrations_1 = require("@mikro-orm/migrations");
class Migration20250507055941 extends migrations_1.Migration {
async up() {
this.addSql(`create table if not exists "extended_variant" ("id" text not null, "thumbnail" text not null, "images" text[] not null, "party_style_id" integer not null, "party_style_date" timestamptz not null, "party_style_code" text not null, "party_style_alias_no" text not null, "style_id" integer not null, "style_code" text not null, "category" text not null, "sub_category" text not null, "manufacturer" text not null, "manufacturer_no" text not null, "make_type" text not null, "stock_type" text not null, "item_size" text not null, "brand" text not null, "gender" text check ("gender" in ('Men', 'Women', 'Unisex', 'Kids')) not null, "shape_code" text not null, "is_complete" boolean not null, "restricted" boolean not null, "currency" text not null, "rate_chart" text not null, "discount_markup" text not null, "cost" real not null, "mrp" real not null, "hsn_code" text not null, "gross_weight" real not null, "net_weight" real not null, "wax_weight" real not null, "model_weight" real not null, "metal" text not null, "metal_purity" text not null, "metal_color" text not null, "total_diamond_pcs" integer not null, "total_diamond_weight" real not null, "total_client_diamond_pcs" integer not null, "total_client_diamond_weight" real not null, "total_stone_pcs" integer not null, "total_stone_weight" real not null, "total_cz_pcs" integer not null, "total_cz_weight" real not null, "web_description" text not null, "remarks" text not null, "customer_remarks" text not null, "special_remarks" text not null, "metal_total_cost" real not null, "diamond_total_cost" real not null, "stone_total_cost" real not null, "cpf_total_cost" real not null, "metal_total_amount" real not null, "diamond_total_amount" real not null, "stone_total_amount" real not null, "cpf_total_amount" real not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "extended_variant_pkey" primary key ("id"));`);
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_extended_variant_deleted_at" ON "extended_variant" (deleted_at) WHERE deleted_at IS NULL;`);
this.addSql(`create table if not exists "party_style_details_line" ("id" text not null, "party_style_id" integer not null, "party_style_mst_detail_id" integer not null, "item_code" text not null, "raw_type" text not null, "material_group" text not null, "raw_code" text not null, "shape_code" text not null, "qly_code" text not null, "tone_code" text not null, "description" text not null, "size" text not null, "accessories" text not null, "setting" text not null, "is_base" boolean not null, "is_center_stone" boolean not null, "pieces" integer not null, "weight" real not null, "min_weight" real not null, "max_weight" real not null, "stone_wt" real not null, "default_wt" real not null, "raw_formula" text not null, "cost_rate" real not null, "cost_amount" real not null, "hand_cost_rate" real not null, "hand_cost_amount" real not null, "set_cost_rate" real not null, "set_cost_amount" real not null, "loss_cost_per" real not null, "loss_cost_per_is_fix" boolean not null, "loss_cost_weight" real not null, "loss_cost_amt" real not null, "cpf_cost_rate" real not null, "cpf_cost_is_fix" boolean not null, "cpf_cost_amt" real not null, "rate" real not null, "amount" real not null, "hand_rate" real not null, "hand_amount" real not null, "set_rate" real not null, "set_amount" real not null, "loss_per" real not null, "loss_per_is_fix" boolean not null, "loss_weight" real not null, "loss_amt" real not null, "cpf_rate" real not null, "cpf_is_fix" boolean not null, "cpf_amt" real not null, "extended_variant_id" text not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "party_style_details_line_pkey" primary key ("id"));`);
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_party_style_details_line_extended_variant_id" ON "party_style_details_line" (extended_variant_id) WHERE deleted_at IS NULL;`);
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_party_style_details_line_deleted_at" ON "party_style_details_line" (deleted_at) WHERE deleted_at IS NULL;`);
this.addSql(`create table if not exists "party_style_exploration_line" ("id" text not null, "party_style_id" integer not null, "exploration_code" text not null, "exploration_value" text not null, "extended_variant_id" text not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "party_style_exploration_line_pkey" primary key ("id"));`);
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_party_style_exploration_line_extended_variant_id" ON "party_style_exploration_line" (extended_variant_id) WHERE deleted_at IS NULL;`);
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_party_style_exploration_line_deleted_at" ON "party_style_exploration_line" (deleted_at) WHERE deleted_at IS NULL;`);
this.addSql(`alter table if exists "party_style_details_line" add constraint "party_style_details_line_extended_variant_id_foreign" foreign key ("extended_variant_id") references "extended_variant" ("id") on update cascade;`);
this.addSql(`alter table if exists "party_style_exploration_line" add constraint "party_style_exploration_line_extended_variant_id_foreign" foreign key ("extended_variant_id") references "extended_variant" ("id") on update cascade;`);
}
async down() {
this.addSql(`alter table if exists "party_style_details_line" drop constraint if exists "party_style_details_line_extended_variant_id_foreign";`);
this.addSql(`alter table if exists "party_style_exploration_line" drop constraint if exists "party_style_exploration_line_extended_variant_id_foreign";`);
this.addSql(`drop table if exists "extended_variant" cascade;`);
this.addSql(`drop table if exists "party_style_details_line" cascade;`);
this.addSql(`drop table if exists "party_style_exploration_line" cascade;`);
}
}
exports.Migration20250507055941 = Migration20250507055941;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTA1MDcwNTU5NDEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9leHRlbmRlZC12YXJpYW50L21pZ3JhdGlvbnMvTWlncmF0aW9uMjAyNTA1MDcwNTU5NDEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsc0RBQWtEO0FBRWxELE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFFM0MsS0FBSyxDQUFDLEVBQUU7UUFDZixJQUFJLENBQUMsTUFBTSxDQUFDLGc3REFBZzdELENBQUMsQ0FBQztRQUM5N0QsSUFBSSxDQUFDLE1BQU0sQ0FBQywySEFBMkgsQ0FBQyxDQUFDO1FBRXpJLElBQUksQ0FBQyxNQUFNLENBQUMsaXJEQUFpckQsQ0FBQyxDQUFDO1FBQy9yRCxJQUFJLENBQUMsTUFBTS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