-- Drop index "idx_order_src" from table: "McuOrderItem"
DROP INDEX "public"."idx_order_src";
-- Modify "McuOrderItem" table
ALTER TABLE "public"."McuOrderItem" DROP CONSTRAINT "fk_McuOrderItem_McuSrc", DROP COLUMN "McuSrc_Id", ALTER COLUMN "McuSrc_Code" TYPE character varying(20), ADD CONSTRAINT "fk_McuOrderItem_McuSrc" FOREIGN KEY ("McuSrc_Code") REFERENCES "public"."McuSrc" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Create index "idx_order_src" to table: "McuOrderItem"
CREATE UNIQUE INDEX "idx_order_src" ON "public"."McuOrderItem" ("McuOrder_Id", "McuSrc_Code");
-- Drop index "idx_order_sub_src" from table: "McuOrderSubItem"
DROP INDEX "public"."idx_order_sub_src";
-- Modify "McuOrderSubItem" table
ALTER TABLE "public"."McuOrderSubItem" DROP CONSTRAINT "fk_McuOrderSubItem_McuSubSrc", DROP COLUMN "McuSubSrc_Id", ALTER COLUMN "McuSubSrc_Code" TYPE character varying(20), ADD CONSTRAINT "fk_McuOrderSubItem_McuSubSrc" FOREIGN KEY ("McuSubSrc_Code") REFERENCES "public"."McuSubSrc" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Create index "idx_order_sub_src" to table: "McuOrderSubItem"
CREATE UNIQUE INDEX "idx_order_sub_src" ON "public"."McuOrderSubItem" ("McuSubSrc_Code", "McuOrderItem_Id");
