-- Tables

-- Alters

ALTER TABLE STOR.T_INVENTORY_ELEMENTS_REMAINS ADD "specifiedquantity" decimal(31, 10) NULL;

UPDATE STOR.T_INVENTORY_ELEMENTS_REMAINS SET "specifiedquantity" = 0;

ALTER TABLE STOR.T_INVENTORY_ELEMENTS_REMAINS ALTER COLUMN "specifiedquantity" SET NOT NULL;

ALTER TABLE STOR.T_INVENTORY_ELEMENTS_REMAINS ADD "specifiedpackagetype" uuid NULL;

ALTER TABLE STOR.T_INVENTORY_ELEMENTS_REMAINS ADD CONSTRAINT FK_T_PACKAGE_TYPE_T_INVENTORY_ELEMENTS_REMAINS_Specifi_D8D117D3
FOREIGN KEY("specifiedpackagetype") REFERENCES PHARM.T_PACKAGE_TYPE (PackageTypeID);


ALTER TABLE STOR.T_SCANNED_INVENTORY_ELEMENTS ADD "specifiedquantity" decimal(20, 6) NULL;

UPDATE STOR.T_SCANNED_INVENTORY_ELEMENTS SET "specifiedquantity" = 0;

ALTER TABLE STOR.T_SCANNED_INVENTORY_ELEMENTS ALTER COLUMN "specifiedquantity" SET NOT NULL;

ALTER TABLE STOR.T_SCANNED_INVENTORY_ELEMENTS ADD "specifiedpackagetype" uuid NULL;

ALTER TABLE STOR.T_SCANNED_INVENTORY_ELEMENTS ADD CONSTRAINT FK_T_PACKAGE_TYPE_T_SCANNED_INVENTORY_ELEMENTS_Specifi_1A0A9731
FOREIGN KEY("specifiedpackagetype") REFERENCES PHARM.T_PACKAGE_TYPE (PackageTypeID);
