diff --git a/mysql/tables/llx_mailing_cibles.key.sql b/mysql/tables/llx_mailing_cibles.key.sql new file mode 100644 index 00000000000..4af70d34afe --- /dev/null +++ b/mysql/tables/llx_mailing_cibles.key.sql @@ -0,0 +1,24 @@ +-- =================================================================== +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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_mailing_cibles ADD UNIQUE uk_mailing_cibles (fk_mailing, email); diff --git a/mysql/tables/llx_user_rights.key.sql b/mysql/tables/llx_user_rights.key.sql new file mode 100644 index 00000000000..d9aa1f9d508 --- /dev/null +++ b/mysql/tables/llx_user_rights.key.sql @@ -0,0 +1,29 @@ +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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_user_rights +from llx_user_rights +left join llx_user on llx_user_rights.fk_user = llx_user.rowid +where llx_user.rowid is null; + +ALTER TABLE llx_user_rights ADD FOREIGN KEY (fk_user) REFERENCES llx_user (rowid); diff --git a/mysql/tables/llx_usergroup_rights.key.sql b/mysql/tables/llx_usergroup_rights.key.sql new file mode 100644 index 00000000000..8819913dd49 --- /dev/null +++ b/mysql/tables/llx_usergroup_rights.key.sql @@ -0,0 +1,29 @@ +-- ============================================================================ +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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_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); diff --git a/mysql/tables/llx_usergroup_rights.sql b/mysql/tables/llx_usergroup_rights.sql new file mode 100644 index 00000000000..510d7d6b7c4 --- /dev/null +++ b/mysql/tables/llx_usergroup_rights.sql @@ -0,0 +1,31 @@ +-- ============================================================================ +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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$ +-- +-- =========================================================================== + +create table llx_usergroup_rights +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_usergroup integer NOT NULL, + fk_id integer NOT NULL, + + UNIQUE(fk_usergroup,fk_id) +)type=innodb; +