-- Modify "DeviceOrderItem" table
ALTER TABLE "public"."DeviceOrderItem" DROP CONSTRAINT "fk_DeviceOrderItem_Device", DROP COLUMN "Device_Id", ALTER COLUMN "Device_Code" TYPE character varying(10), ADD CONSTRAINT "fk_DeviceOrderItem_Device" FOREIGN KEY ("Device_Code") REFERENCES "public"."Device" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Modify "MaterialOrderItem" table
ALTER TABLE "public"."MaterialOrderItem" DROP CONSTRAINT "fk_MaterialOrderItem_Material", DROP COLUMN "Material_Id", ALTER COLUMN "Material_Code" TYPE character varying(10), ADD CONSTRAINT "fk_MaterialOrderItem_Material" FOREIGN KEY ("Material_Code") REFERENCES "public"."Material" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
