Qual: Ajout des cls dans les fichiers keys.
This commit is contained in:
parent
5efd7dccd6
commit
cb786e5a2b
24
mysql/tables/llx_c_regions.key.sql
Normal file
24
mysql/tables/llx_c_regions.key.sql
Normal file
@ -0,0 +1,24 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- $Id$
|
||||
-- $Source$
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 2 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
|
||||
ALTER TABLE llx_c_regions ADD CONSTRAINT c_regions_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_pays (rowid);
|
||||
@ -21,14 +21,11 @@
|
||||
--
|
||||
-- ============================================================================
|
||||
|
||||
--
|
||||
--
|
||||
ALTER TABLE llx_facture ADD INDEX (fk_soc);
|
||||
|
||||
ALTER TABLE llx_facture ADD INDEX (fk_user_author);
|
||||
ALTER TABLE llx_facture ADD INDEX (fk_user_valid);
|
||||
--
|
||||
--
|
||||
|
||||
ALTER TABLE llx_facture ADD FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp);
|
||||
|
||||
ALTER TABLE llx_facture ADD FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
|
||||
|
||||
25
mysql/tables/llx_facture_tva_sum.key.sql
Normal file
25
mysql/tables/llx_facture_tva_sum.key.sql
Normal file
@ -0,0 +1,25 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 2 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
--
|
||||
-- $Id$
|
||||
-- $Source$
|
||||
-- ===================================================================
|
||||
|
||||
-- Supprimme orhpelins pour permettre montée de la clé
|
||||
DELETE llx_facture_tva_sum FROM llx_facture_tva_sum LEFT JOIN llx_facture ON llx_facture_tva_sum.fk_facture = llx_facture.rowid WHERE llx_facture.rowid IS NULL;
|
||||
|
||||
ALTER TABLE llx_facture_tva_sum ADD CONSTRAINT facture_tva_sum_fk_facture_rowid FOREIGN KEY (fk_facture) REFERENCES llx_facture (rowid);
|
||||
25
mysql/tables/llx_facturedet.key.sql
Normal file
25
mysql/tables/llx_facturedet.key.sql
Normal file
@ -0,0 +1,25 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 2 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
--
|
||||
-- $Id$
|
||||
-- $Source$
|
||||
-- ===================================================================
|
||||
|
||||
-- Supprimme orhpelins pour permettre montée de la clé
|
||||
DELETE llx_facturedet FROM llx_facturedet LEFT JOIN llx_facture ON llx_facturedet.fk_facture = llx_facture.rowid WHERE llx_facture.rowid IS NULL;
|
||||
|
||||
ALTER TABLE llx_facturedet ADD CONSTRAINT facturedet_fk_facture_rowid FOREIGN KEY (fk_facture) REFERENCES llx_facture (rowid);
|
||||
23
mysql/tables/llx_fichinter.key.sql
Normal file
23
mysql/tables/llx_fichinter.key.sql
Normal file
@ -0,0 +1,23 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 2 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
--
|
||||
-- $Id$
|
||||
-- $Source$
|
||||
--
|
||||
-- ===================================================================
|
||||
|
||||
ALTER TABLE llx_fichinter ADD CONSTRAINT fichinter_fk_soc_idp FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp);
|
||||
28
mysql/tables/llx_paiement_facture.key.sql
Normal file
28
mysql/tables/llx_paiement_facture.key.sql
Normal file
@ -0,0 +1,28 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 2 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
--
|
||||
-- $Id$
|
||||
-- $Source$
|
||||
--
|
||||
-- ===========================================================================
|
||||
|
||||
-- Supprimme orhpelins pour permettre montée de la clé
|
||||
DELETE llx_paiement_facture FROM llx_paiement_facture LEFT JOIN llx_facture ON llx_paiement_facture.fk_facture = llx_facture.rowid WHERE llx_facture.rowid IS NULL;
|
||||
DELETE llx_paiement_facture FROM llx_paiement_facture LEFT JOIn llx_paiement ON llx_paiement_facture.fk_facture = llx_paiement.rowid WHERE llx_paiement.rowid IS NULL;
|
||||
|
||||
ALTER TABLE llx_paiement_facture ADD CONSTRAINT paiement_facture_fk_facture FOREIGN KEY (fk_facture) REFERENCES llx_facture (rowid);
|
||||
ALTER TABLE llx_paiement_facture ADD CONSTRAINT paiement_facture_fk_paiement FOREIGN KEY (fk_paiement) REFERENCES llx_paiement (rowid);
|
||||
@ -21,10 +21,7 @@
|
||||
--
|
||||
-- ============================================================================
|
||||
|
||||
--
|
||||
--
|
||||
ALTER TABLE llx_propal ADD INDEX (fk_soc);
|
||||
--
|
||||
--
|
||||
|
||||
ALTER TABLE llx_propal ADD FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp);
|
||||
|
||||
|
||||
24
mysql/tables/llx_socpeople.key.sql
Normal file
24
mysql/tables/llx_socpeople.key.sql
Normal file
@ -0,0 +1,24 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 2 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
--
|
||||
-- $Id$
|
||||
-- $Source$
|
||||
--
|
||||
-- ============================================================================
|
||||
|
||||
|
||||
ALTER TABLE llx_socpeople ADD CONSTRAINT socpeople_fk_soc_idp FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp);
|
||||
@ -21,9 +21,6 @@
|
||||
-- ===========================================================================
|
||||
|
||||
-- Supprimme orhpelins pour permettre montée de la clé
|
||||
delete llx_usergroup_rights
|
||||
from llx_usergroup_rights
|
||||
left join llx_usergroup on llx_usergroup_rights.fk_user = llx_usergroup.rowid
|
||||
where llx_usergroup.rowid is null;
|
||||
DELETE llx_usergroup_rights FROM llx_usergroup_rights LEFT JOIN llx_usergroup ON llx_usergroup_rights.fk_user = llx_usergroup.rowid WHERE llx_usergroup.rowid IS NULL;
|
||||
|
||||
ALTER TABLE llx_usergroup_rights ADD FOREIGN KEY (fk_usergroup) REFERENCES llx_usergroup (rowid);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user