 
if not exists (select * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS where CONSTRAINT_NAME= 'FK_doc_tarea_id_catalogo')
begin 
ALTER TABLE [doc_tarea] ADD CONSTRAINT
	FK_doc_tarea_id_catalogo FOREIGN KEY
	([id_catalogo]) REFERENCES [cat_catalogo]
	(id) 
end
if not exists (select * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS where CONSTRAINT_NAME= 'FK_doc_tarea_id_cargo')
begin 
 ALTER TABLE [doc_tarea] ADD CONSTRAINT
	FK_doc_tarea_id_cargo FOREIGN KEY
	([id_cargo]) REFERENCES [seg_cargo]
	(id)
end

if not exists (select * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS where CONSTRAINT_NAME= 'FK_doc_documentoComentario_id_usuario')
begin 
 ALTER TABLE [doc_documentoComentario] ADD CONSTRAINT
	FK_doc_documentoComentario_id_usuario FOREIGN KEY
	([id_usuario]) REFERENCES [seg_usuario]
	(id)
end

if not exists (select * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS where CONSTRAINT_NAME= 'FK_doc_documentoComentario_id_documento')
begin 
 ALTER TABLE [doc_documentoComentario] ADD CONSTRAINT
	FK_doc_documentoComentario_id_documento FOREIGN KEY
	([id_documento]) REFERENCES [doc_documento]
	(id)
end

if not exists (select * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS where CONSTRAINT_NAME= 'FK_doc_documentoComentario_id_documentoComentario')
begin 
 ALTER TABLE [doc_documentoComentario] ADD CONSTRAINT
	FK_doc_documentoComentario_id_documentoComentario FOREIGN KEY
	([id_documentoComentario]) REFERENCES [doc_documentoComentario]
	(id) 

end