ALTER TABLE DATA_STORES ADD COLUMN UUID CODE;
ALTER TABLE DATA_STORES DROP CONSTRAINT DAST_DBIN_FK;
ALTER TABLE DATA_STORES DROP CONSTRAINT DAST_BK_UK;
ALTER TABLE DATA_STORES ADD CONSTRAINT DAST_BK_UK UNIQUE(CODE,UUID);
UPDATE DATA_STORES AS d SET UUID = (SELECT i.UUID FROM DATABASE_INSTANCES i WHERE i.ID = d.DBIN_ID);
ALTER TABLE DATA_STORES DROP COLUMN DBIN_ID;
DROP TABLE DATABASE_INSTANCES;
ALTER TABLE DATA_STORES ALTER COLUMN UUID SET NOT NULL;

