ALTER TABLE VCLib.T_ENTITIES_WEB_ALIAS ADD "webapp" uuid NULL;

UPDATE VCLib.T_ENTITIES_WEB_ALIAS SET "webapp" = (select webappid from VCLib.T_WEB_APP limit 1);

ALTER TABLE VCLib.T_ENTITIES_WEB_ALIAS ALTER COLUMN "webapp" SET NOT NULL;

ALTER TABLE VCLib.T_ENTITIES_WEB_ALIAS ADD CONSTRAINT FK_T_WEB_APP_T_ENTITIES_WEB_ALIAS_WebApp
FOREIGN KEY("webapp") REFERENCES VCLib.T_WEB_APP (WebAppID);



ALTER TABLE VCLib.T_DTO_MODEL ADD "webapp" uuid NULL;

UPDATE VCLib.T_DTO_MODEL SET "webapp" = (select webappid from VCLib.T_WEB_APP limit 1);

ALTER TABLE VCLib.T_DTO_MODEL ALTER COLUMN "webapp" SET NOT NULL;

ALTER TABLE VCLib.T_DTO_MODEL ADD CONSTRAINT FK_T_WEB_APP_T_DTO_MODEL_WebApp
FOREIGN KEY("webapp") REFERENCES VCLib.T_WEB_APP (WebAppID);
