if not exists (select * FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='doc_pendienteDocumento_doc_itemDocumento'  and column_name = 'id_pendienteDocumento' )
begin 
alter table [doc_pendienteDocumento_doc_itemDocumento] add [id_pendienteDocumento] int NOT NULL DEFAULT 0  FOREIGN KEY (id_pendienteDocumento) REFERENCES doc_pendienteDocumento(id)
end

go

if not exists (select * FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='doc_pendienteDocumento_doc_itemDocumento'  and column_name = 'id_itemDocumento' )
begin 
alter table [doc_pendienteDocumento_doc_itemDocumento] add [id_itemDocumento] int NOT NULL DEFAULT 0  FOREIGN KEY (id_itemDocumento) REFERENCES doc_itemDocumento(id)
end

go
