-- Tables

-- Alters

ALTER TABLE VCLib.T_NEWS_BOX ADD "type_" integer NULL;

UPDATE VCLib.T_NEWS_BOX SET "type_" = (select entityid from VCLib.T_ENTITIES where EntName = 'NEWS_BOX' limit 1);

ALTER TABLE VCLib.T_NEWS_BOX ALTER COLUMN "type_" SET NOT NULL;

ALTER TABLE VCLib.T_NEWS_BOX ADD CONSTRAINT FK_T_ENTITIES_T_NEWS_BOX_type_
FOREIGN KEY("type_") REFERENCES VCLib.T_ENTITIES (EntityID);

