alter table ConsumingObjects 
	add foreign key (BuildingID)
	references Buildings

alter table ConsumingObjects 
	add foreign key (TypeID)
	references ConsumingObjectTypes(TypeID)

alter table ConsumingObjects add foreign key (AddressID) references Addresses

alter table ConsumingObjects 
	add foreign key (DelineationID)
	references Delineations(DelineationID)

ALTER TABLE ConsumingObjects 
	ADD FOREIGN KEY (SupplyContractID)
				REFERENCES SupplyContracts

alter table ConsumingObjects 
	add foreign key (OldVersionID)
		references ConsumingObjects(ID)
		
ALTER TABLE ConsumingObjects
	ADD FOREIGN KEY (RightHolderID)
	REFERENCES LegalEntities(LegalEntityID)
	
ALTER TABLE ConsumingObjects
	ADD FOREIGN KEY (SingleLineDiagramID)
	REFERENCES StoreDocuments(DocumentID)	 
