diff --git a/htdocs/telephonie/sql/llx_telephonie_adsl_fournisseur.key.sql b/htdocs/telephonie/sql/llx_telephonie_adsl_fournisseur.key.sql index 0a8e8d8d331..230ea98220a 100644 --- a/htdocs/telephonie/sql/llx_telephonie_adsl_fournisseur.key.sql +++ b/htdocs/telephonie/sql/llx_telephonie_adsl_fournisseur.key.sql @@ -26,5 +26,5 @@ ALTER TABLE llx_telephonie_adsl_fournisseur ADD INDEX (fk_soc); -- -- -ALTER TABLE llx_telephonie_adsl_fournisseur ADD FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid); +ALTER TABLE llx_telephonie_adsl_fournisseur ADD CONSTRAINT fk_telephonie_adsl_fournisseur_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid); diff --git a/htdocs/telephonie/sql/llx_telephonie_client_stats.key.sql b/htdocs/telephonie/sql/llx_telephonie_client_stats.key.sql index de2ba21057a..dc76e441177 100644 --- a/htdocs/telephonie/sql/llx_telephonie_client_stats.key.sql +++ b/htdocs/telephonie/sql/llx_telephonie_client_stats.key.sql @@ -23,4 +23,4 @@ -- -ALTER TABLE llx_telephonie_client_stats ADD FOREIGN KEY (fk_client_comm) REFERENCES llx_societe(rowid); +ALTER TABLE llx_telephonie_client_stats ADD CONSTRAINT fk_telephonie_client_stats_societe FOREIGN KEY (fk_client_comm) REFERENCES llx_societe(rowid); diff --git a/htdocs/telephonie/sql/llx_telephonie_contact_facture.key.sql b/htdocs/telephonie/sql/llx_telephonie_contact_facture.key.sql index b2eea1647b7..e4795d7c9be 100644 --- a/htdocs/telephonie/sql/llx_telephonie_contact_facture.key.sql +++ b/htdocs/telephonie/sql/llx_telephonie_contact_facture.key.sql @@ -6,5 +6,5 @@ ALTER TABLE llx_telephonie_contact_facture ADD INDEX (fk_contact); ALTER TABLE llx_telephonie_contact_facture ADD INDEX (fk_ligne); -ALTER TABLE llx_telephonie_contact_facture ADD FOREIGN KEY (fk_contact) REFERENCES llx_socpeople (rowid); -ALTER TABLE llx_telephonie_contact_facture ADD FOREIGN KEY (fk_ligne) REFERENCES llx_telephonie_societe_ligne (rowid); +ALTER TABLE llx_telephonie_contact_facture ADD CONSTRAINT fk_telephonie_contact_facture_contact FOREIGN KEY (fk_contact) REFERENCES llx_socpeople (rowid); +ALTER TABLE llx_telephonie_contact_facture ADD CONSTRAINT fk_telephonie_contact_facture_ligne FOREIGN KEY (fk_ligne) REFERENCES llx_telephonie_societe_ligne (rowid); diff --git a/htdocs/telephonie/sql/llx_telephonie_societe_ligne.key.sql b/htdocs/telephonie/sql/llx_telephonie_societe_ligne.key.sql index 08238d2a8ed..ec06fcf1001 100644 --- a/htdocs/telephonie/sql/llx_telephonie_societe_ligne.key.sql +++ b/htdocs/telephonie/sql/llx_telephonie_societe_ligne.key.sql @@ -37,13 +37,11 @@ ALTER TABLE llx_telephonie_societe_ligne ADD INDEX (fk_user_commande); ALTER TABLE llx_telephonie_societe_ligne ADD INDEX (fk_commercial); ALTER TABLE llx_telephonie_societe_ligne ADD INDEX (fk_concurrent); -ALTER TABLE llx_telephonie_societe_ligne ADD FOREIGN KEY (fk_fournisseur) REFERENCES llx_telephonie_fournisseur (rowid); -ALTER TABLE llx_telephonie_societe_ligne ADD FOREIGN KEY (fk_client_comm) REFERENCES llx_societe(rowid); -ALTER TABLE llx_telephonie_societe_ligne ADD FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid); -ALTER TABLE llx_telephonie_societe_ligne ADD FOREIGN KEY (fk_soc_facture) REFERENCES llx_societe(rowid); -ALTER TABLE llx_telephonie_societe_ligne ADD FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); -ALTER TABLE llx_telephonie_societe_ligne ADD FOREIGN KEY (fk_user_commande) REFERENCES llx_user(rowid); -ALTER TABLE llx_telephonie_societe_ligne ADD FOREIGN KEY (fk_commercial) REFERENCES llx_user(rowid); -ALTER TABLE llx_telephonie_societe_ligne ADD FOREIGN KEY (fk_concurrent) REFERENCES llx_telephonie_concurrents (rowid); - - +ALTER TABLE llx_telephonie_societe_ligne ADD CONSTRAINT llx_telephonie_societe_ligne_fournisseur FOREIGN KEY (fk_fournisseur) REFERENCES llx_telephonie_fournisseur (rowid); +ALTER TABLE llx_telephonie_societe_ligne ADD CONSTRAINT llx_telephonie_societe_ligne_client_comm FOREIGN KEY (fk_client_comm) REFERENCES llx_societe(rowid); +ALTER TABLE llx_telephonie_societe_ligne ADD CONSTRAINT llx_telephonie_societe_ligne_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid); +ALTER TABLE llx_telephonie_societe_ligne ADD CONSTRAINT llx_telephonie_societe_ligne_soc_facture FOREIGN KEY (fk_soc_facture) REFERENCES llx_societe(rowid); +ALTER TABLE llx_telephonie_societe_ligne ADD CONSTRAINT llx_telephonie_societe_ligne_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); +ALTER TABLE llx_telephonie_societe_ligne ADD CONSTRAINT llx_telephonie_societe_ligne_user_commande FOREIGN KEY (fk_user_commande) REFERENCES llx_user(rowid); +ALTER TABLE llx_telephonie_societe_ligne ADD CONSTRAINT llx_telephonie_societe_ligne_commercial FOREIGN KEY (fk_commercial) REFERENCES llx_user(rowid); +ALTER TABLE llx_telephonie_societe_ligne ADD CONSTRAINT llx_telephonie_societe_ligne_concurrent FOREIGN KEY (fk_concurrent) REFERENCES llx_telephonie_concurrents (rowid); diff --git a/htdocs/telephonie/sql/llx_telephonie_tarif_client.key.sql b/htdocs/telephonie/sql/llx_telephonie_tarif_client.key.sql index 9d2e1479915..237cc78cd5a 100644 --- a/htdocs/telephonie/sql/llx_telephonie_tarif_client.key.sql +++ b/htdocs/telephonie/sql/llx_telephonie_tarif_client.key.sql @@ -26,6 +26,6 @@ ALTER TABLE llx_telephonie_tarif_client ADD INDEX (fk_tarif); ALTER TABLE llx_telephonie_tarif_client ADD INDEX (fk_client); ALTER TABLE llx_telephonie_tarif_client ADD INDEX (fk_user); -ALTER TABLE llx_telephonie_tarif_client ADD FOREIGN KEY (fk_tarif) REFERENCES llx_telephonie_tarif (rowid); -ALTER TABLE llx_telephonie_tarif_client ADD FOREIGN KEY (fk_client) REFERENCES llx_societe (rowid); -ALTER TABLE llx_telephonie_tarif_client ADD FOREIGN KEY (fk_user) REFERENCES llx_user (rowid); +ALTER TABLE llx_telephonie_tarif_client ADD CONSTRAINT llx_telephonie_tarif_client_tarif FOREIGN KEY (fk_tarif) REFERENCES llx_telephonie_tarif (rowid); +ALTER TABLE llx_telephonie_tarif_client ADD CONSTRAINT llx_telephonie_tarif_client_client FOREIGN KEY (fk_client) REFERENCES llx_societe (rowid); +ALTER TABLE llx_telephonie_tarif_client ADD CONSTRAINT llx_telephonie_tarif_client_user FOREIGN KEY (fk_user) REFERENCES llx_user (rowid); diff --git a/mysql/migration/2.1.0-2.2.0.sql b/mysql/migration/2.1.0-2.2.0.sql index fd04c72262b..e4361976d78 100644 --- a/mysql/migration/2.1.0-2.2.0.sql +++ b/mysql/migration/2.1.0-2.2.0.sql @@ -736,13 +736,14 @@ ALTER TABLE `llx_osc_product` ADD UNIQUE KEY `fk_product` (`fk_product`); -- V4 ALTER TABLE llx_osc_customer ADD CONSTRAINT fk_osc_customer_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid); --- V4 ALTER TABLE llx_telephonie_adsl_fournisseur ADD FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid); --- V4 ALTER TABLE llx_telephonie_client_stats ADD FOREIGN KEY (fk_client_comm) REFERENCES llx_societe(rowid); --- V4 ALTER TABLE llx_telephonie_contact_facture ADD FOREIGN KEY (fk_contact) REFERENCES llx_socpeople (rowid); --- V4 ALTER TABLE llx_telephonie_societe_ligne ADD FOREIGN KEY (fk_client_comm) REFERENCES llx_societe(rowid); --- V4 ALTER TABLE llx_telephonie_societe_ligne ADD FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid); --- V4 ALTER TABLE llx_telephonie_societe_ligne ADD FOREIGN KEY (fk_soc_facture) REFERENCES llx_societe(rowid); --- V4 ALTER TABLE llx_telephonie_tarif_client ADD FOREIGN KEY (fk_client) REFERENCES llx_societe (rowid); +-- V4 ALTER TABLE llx_telephonie_adsl_fournisseur ADD CONSTRAINT fk_telephonie_adsl_fournisseur_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid); +-- V4 ALTER TABLE llx_telephonie_client_stats ADD CONSTRAINT fk_telephonie_client_stats_societe FOREIGN KEY (fk_client_comm) REFERENCES llx_societe(rowid); +-- V4 ALTER TABLE llx_telephonie_contact_facture ADD CONSTRAINT fk_telephonie_contact_facture_contact FOREIGN KEY (fk_contact) REFERENCES llx_socpeople (rowid); +-- V4 ALTER TABLE llx_telephonie_contact_facture ADD CONSTRAINT fk_telephonie_contact_facture_ligne FOREIGN KEY (fk_ligne) REFERENCES llx_telephonie_societe_ligne (rowid); +-- V4 ALTER TABLE llx_telephonie_societe_ligne ADD CONSTRAINT llx_telephonie_societe_ligne_client_comm FOREIGN KEY (fk_client_comm) REFERENCES llx_societe(rowid); +-- V4 ALTER TABLE llx_telephonie_societe_ligne ADD CONSTRAINT llx_telephonie_societe_ligne_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid); +-- V4 ALTER TABLE llx_telephonie_societe_ligne ADD CONSTRAINT llx_telephonie_societe_ligne_soc_facture FOREIGN KEY (fk_soc_facture) REFERENCES llx_societe(rowid); +-- V4 ALTER TABLE llx_telephonie_tarif_client ADD CONSTRAINT llx_telephonie_tarif_client_client FOREIGN KEY (fk_client) REFERENCES llx_societe (rowid); -- fin du changement idp en rowid insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (120, 'fichinter','internal', 'INTERREPFOLL', 'Responsable suivi de l\'intervention', 1);