mschaefer@9637: --Neues Feld infrastructure.group_id
mschaefer@9637: 
mschaefer@9637: SET AUTOCOMMIT ON;
mschaefer@9637: 
mschaefer@9637: ALTER TABLE infrastructure ADD (group_id NUMBER(38,0));
mschaefer@9637: 
mschaefer@9637: UPDATE infrastructure SET group_id=annotation_type_id;
mschaefer@9637: 
mschaefer@9637: ALTER TABLE infrastructure MODIFY (group_id NOT NULL);
mschaefer@9637: 
mschaefer@9637: ALTER TABLE infrastructure ADD CONSTRAINT cInfrastructureGroupAnnoType
mschaefer@9637:       FOREIGN KEY (group_id) REFERENCES annotation_types;
mschaefer@9637: 
mschaefer@9637: COMMENT ON COLUMN infrastructure.group_id IS 'Reference to the infrastructure type group';
mschaefer@9637: 
mschaefer@9637: COMMIT;