-- Tables

-- Alters

--ALTER TABLE STOR.T_INVOICE_ITEM ALTER COLUMN "comment" SET DATA TYPE varchar(255);

ALTER TABLE STOR.T_INVOICE_ITEM ALTER COLUMN "comment" DROP NOT NULL;

update STOR.T_INVOICE_ITEM set "comment" = null where "comment" = '';


ALTER TABLE STOR.T_INVOICE_ITEM ALTER COLUMN "gtinserialnumber" DROP NOT NULL;
update STOR.T_INVOICE_ITEM set "gtinserialnumber" = null where "gtinserialnumber" = '';


ALTER TABLE STOR.T_INVOICE_ITEM ALTER COLUMN "conversionid" DROP NOT NULL;
update STOR.T_INVOICE_ITEM set "conversionid" = null where "conversionid" = '';


--ALTER TABLE STOR.T_REMAINS ALTER COLUMN "comment" SET DATA TYPE varchar(255);

ALTER TABLE STOR.T_REMAINS ALTER COLUMN "comment" DROP NOT NULL;
update STOR.T_REMAINS set "comment" = null where "comment" = '';


ALTER TABLE STOR.T_REMAINS ALTER COLUMN "gtinserialnumber" DROP NOT NULL;
update STOR.T_REMAINS set "gtinserialnumber" = null where "gtinserialnumber" = '';


ALTER TABLE STOR.T_REMAINS ALTER COLUMN "conversionid" DROP NOT NULL;
update STOR.T_REMAINS set "conversionid" = null where "conversionid" = '';
