diff --git a/htdocs/install/mysql/tables/llx_extra_fields.key.sql b/htdocs/install/mysql/tables/llx_extra_fields.key.sql new file mode 100644 index 00000000000..a339c255ed0 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_extra_fields.key.sql @@ -0,0 +1,23 @@ +-- ============================================================================ +-- Copyright (C) 2010 Regis Houssin +-- +-- 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$ +-- ============================================================================ + + +ALTER TABLE llx_extra_fields ADD UNIQUE INDEX idx_extra_fields_name (name, entity); + diff --git a/htdocs/install/mysql/tables/llx_extra_fields.sql b/htdocs/install/mysql/tables/llx_extra_fields.sql new file mode 100644 index 00000000000..474f8d1c613 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_extra_fields.sql @@ -0,0 +1,37 @@ +-- =================================================================== +-- Copyright (C) 2010 Regis Houssin +-- +-- 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$ +-- =================================================================== + +create table llx_extra_fields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + entity integer DEFAULT 1 NOT NULL, -- multi company id + + object varchar(64) NOT NULL, + assign integer, + name varchar(64) NOT NULL, + label varchar(64) NOT NULL, + format varchar(8) NOT NULL, + fieldsize integer, + maxlength integer, + options varchar(45), + rank integer + +)type=innodb; diff --git a/htdocs/install/mysql/tables/llx_extra_fields_options.key.sql b/htdocs/install/mysql/tables/llx_extra_fields_options.key.sql new file mode 100644 index 00000000000..4a09b63716c --- /dev/null +++ b/htdocs/install/mysql/tables/llx_extra_fields_options.key.sql @@ -0,0 +1,24 @@ +-- ============================================================================ +-- Copyright (C) 2010 Regis Houssin +-- +-- 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$ +-- ============================================================================ + + +ALTER TABLE llx_extra_fields_options ADD INDEX idx_extra_fields_options_fk_extra_fields (fk_extra_fields, entity); + +ALTER TABLE llx_extra_fields_options ADD CONSTRAINT fk_extra_fields_options_fk_extra_fields FOREIGN KEY (fk_extra_fields) REFERENCES llx_extra_fields (rowid); diff --git a/htdocs/install/mysql/tables/llx_extra_fields_options.sql b/htdocs/install/mysql/tables/llx_extra_fields_options.sql new file mode 100644 index 00000000000..9ae70176830 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_extra_fields_options.sql @@ -0,0 +1,31 @@ +-- =================================================================== +-- Copyright (C) 2010 Regis Houssin +-- +-- 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$ +-- =================================================================== + +create table llx_extra_fields_options +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + + fk_extra_fields integer NOT NULL, + value varchar(255) NOT NULL, + + rank integer + +)type=innodb; diff --git a/htdocs/install/mysql/tables/llx_extra_fields_values.key.sql b/htdocs/install/mysql/tables/llx_extra_fields_values.key.sql new file mode 100644 index 00000000000..aa19918a05c --- /dev/null +++ b/htdocs/install/mysql/tables/llx_extra_fields_values.key.sql @@ -0,0 +1,24 @@ +-- ============================================================================ +-- Copyright (C) 2010 Regis Houssin +-- +-- 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$ +-- ============================================================================ + + +ALTER TABLE llx_extra_fields_values ADD INDEX idx_extra_fields_values_fk_extra_fields (fk_extra_fields, entity); + +ALTER TABLE llx_extra_fields_values ADD CONSTRAINT fk_extra_fields_values_fk_extra_fields FOREIGN KEY (fk_extra_fields) REFERENCES llx_extra_fields (rowid); diff --git a/htdocs/install/mysql/tables/llx_extra_fields_values.sql b/htdocs/install/mysql/tables/llx_extra_fields_values.sql new file mode 100644 index 00000000000..cda62c7c5a4 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_extra_fields_values.sql @@ -0,0 +1,36 @@ +-- =================================================================== +-- Copyright (C) 2010 Regis Houssin +-- +-- 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$ +-- =================================================================== + +create table llx_extra_fields_values +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + entity integer DEFAULT 1 NOT NULL, -- multi company id + + datec datetime, + datem datetime, + fk_object integer NOT NULL, + fk_extra_fields integer NOT NULL, + value varchar(255), + + fk_user_create integer, + fk_user_modif integer + +)type=innodb; diff --git a/htdocs/install/mysql/tables/llx_facture_fourn_det.key.sql b/htdocs/install/mysql/tables/llx_facture_fourn_det.key.sql index 5279ba55b56..f43ab1e746a 100644 --- a/htdocs/install/mysql/tables/llx_facture_fourn_det.key.sql +++ b/htdocs/install/mysql/tables/llx_facture_fourn_det.key.sql @@ -19,7 +19,7 @@ -- =================================================================== --- Supprimme orphelins pour permettre montée de la clé +-- Supprimme orphelins pour permettre montee de la cle -- V4 DELETE llx_facture_fourn_det FROM llx_facture_fourn_det LEFT JOIN llx_facture_fourn ON llx_facture_fourn_det.fk_facture_fourn = llx_facture_fourn.rowid WHERE llx_facture_fourn.rowid IS NULL; ALTER TABLE llx_facture_fourn_det ADD INDEX idx_facture_fourn_det_fk_facture (fk_facture_fourn);