diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 73b29cf55cd..ccd396d9465 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -71,6 +71,10 @@ ALTER TABLE llx_website_page ADD COLUMN type_container varchar(16) NOT NULL DEFA -- For 7.0 +ALTER TABLE llx_product_attribute_value DROP INDEX unique_ref; +ALTER TABLE llx_product_attribute_value ADD UNIQUE INDEX uk_product_attribute_value (fk_product_attribute, ref); + + ALTER TABLE llx_product_price_by_qty ADD COLUMN quantity double DEFAULT NULL; ALTER TABLE llx_product_price_by_qty ADD COLUMN unitprice double(24,8) DEFAULT 0; diff --git a/htdocs/install/mysql/tables/llx_advtargetemailing.sql b/htdocs/install/mysql/tables/llx_advtargetemailing.sql index d2114821f2e..395558c700f 100644 --- a/htdocs/install/mysql/tables/llx_advtargetemailing.sql +++ b/htdocs/install/mysql/tables/llx_advtargetemailing.sql @@ -20,7 +20,7 @@ CREATE TABLE llx_advtargetemailing ( rowid integer NOT NULL auto_increment PRIMARY KEY, - name varchar(200) NOT NULL, + name varchar(180) NOT NULL, entity integer NOT NULL DEFAULT 1, fk_mailing integer NOT NULL, filtervalue text, diff --git a/htdocs/install/mysql/tables/llx_budget_lines.sql b/htdocs/install/mysql/tables/llx_budget_lines.sql index c93a6e736e7..63d015fc8f7 100644 --- a/htdocs/install/mysql/tables/llx_budget_lines.sql +++ b/htdocs/install/mysql/tables/llx_budget_lines.sql @@ -20,7 +20,7 @@ create table llx_budget_lines ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_budget integer NOT NULL, - fk_project_ids varchar(255) NOT NULL, -- 'IDS:x,y' = List of project ids related to this budget. If budget is dedicated to projects not yet started, we recommand to create a project 'Projects to come'. 'FILTER:ref=*ABC' = Can also be a dynamic rule to select projects. + fk_project_ids varchar(180) NOT NULL, -- 'IDS:x,y' = List of project ids related to this budget. If budget is dedicated to projects not yet started, we recommand to create a project 'Projects to come'. 'FILTER:ref=*ABC' or 'FILTER:categid=123' = Can also be a dynamic rule to select projects. amount double(24,8) NOT NULL, datec datetime, tms timestamp, diff --git a/htdocs/install/mysql/tables/llx_c_email_templates.sql b/htdocs/install/mysql/tables/llx_c_email_templates.sql index adcda4c69f8..a4f5a0c25c5 100644 --- a/htdocs/install/mysql/tables/llx_c_email_templates.sql +++ b/htdocs/install/mysql/tables/llx_c_email_templates.sql @@ -28,7 +28,7 @@ create table llx_c_email_templates fk_user integer, -- Id user owner if template is private, or null datec datetime, tms timestamp, - label varchar(255), -- Label of predefined email + label varchar(180), -- Label of predefined email position smallint, -- Position enabled varchar(255) DEFAULT '1', -- Condition to have this module visible active tinyint DEFAULT 1 NOT NULL, diff --git a/htdocs/install/mysql/tables/llx_c_ziptown.sql b/htdocs/install/mysql/tables/llx_c_ziptown.sql index 0eaab74af20..4b73d308a99 100644 --- a/htdocs/install/mysql/tables/llx_c_ziptown.sql +++ b/htdocs/install/mysql/tables/llx_c_ziptown.sql @@ -23,6 +23,6 @@ create table llx_c_ziptown fk_county integer, -- State id in llx_c_departements fk_pays integer NOT NULL DEFAULT 0, -- Country id in llx_c_country zip varchar(10) NOT NULL, -- Zip code - town varchar(255) NOT NULL, -- Town name + town varchar(180) NOT NULL, -- Town name active tinyint NOT NULL DEFAULT 1 )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_categorie.sql b/htdocs/install/mysql/tables/llx_categorie.sql index 708049b01bf..fe2b03b2429 100644 --- a/htdocs/install/mysql/tables/llx_categorie.sql +++ b/htdocs/install/mysql/tables/llx_categorie.sql @@ -2,6 +2,7 @@ -- Copyright (C) 2005 Brice Davoleau -- Copyright (C) 2005 Matthieu Valleton -- Copyright (C) 2005-2012 Regis Houssin +-- Copyright (C) 2017 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 @@ -23,7 +24,7 @@ create table llx_categorie rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, -- multi company id fk_parent integer DEFAULT 0 NOT NULL, - label varchar(255) NOT NULL, -- category name + label varchar(180) NOT NULL, -- category name type tinyint DEFAULT 1 NOT NULL, -- category type (product, supplier, customer, member) description text, -- description of the category color varchar(8), -- color diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql index 0e430c0c483..0b18f46bb51 100644 --- a/htdocs/install/mysql/tables/llx_commande.sql +++ b/htdocs/install/mysql/tables/llx_commande.sql @@ -1,6 +1,7 @@ -- =================================================================== -- Copyright (C) 2003 Rodolphe Quiedeville -- Copyright (C) 2005-2012 Regis Houssin +-- Copyright (C) 2017 Laurent Destailleur -- Copyright (C) 2010 Juanjo Menent -- -- This program is free software; you can redistribute it and/or modify diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur.sql index 930a675c5e1..54ad7a33afd 100644 --- a/htdocs/install/mysql/tables/llx_commande_fournisseur.sql +++ b/htdocs/install/mysql/tables/llx_commande_fournisseur.sql @@ -1,7 +1,7 @@ -- =================================================================== -- Copyright (C) 2004 Rodolphe Quiedeville -- Copyright (C) 2005-2012 Regis Houssin --- Copyright (C) 2007 Laurent Destailleur +-- Copyright (C) 2007-2017 Laurent Destailleur -- Copyright (C) 2010 Juanjo Menent -- -- This program is free software; you can redistribute it and/or modify @@ -23,7 +23,7 @@ create table llx_commande_fournisseur ( rowid integer AUTO_INCREMENT PRIMARY KEY, - ref varchar(255) NOT NULL, -- order number + ref varchar(180) NOT NULL, -- order number entity integer DEFAULT 1 NOT NULL, -- multi company id ref_ext varchar(255), -- reference into an external system (not used by dolibarr) diff --git a/htdocs/install/mysql/tables/llx_const.sql b/htdocs/install/mysql/tables/llx_const.sql index b34801d7e24..22e552213aa 100644 --- a/htdocs/install/mysql/tables/llx_const.sql +++ b/htdocs/install/mysql/tables/llx_const.sql @@ -26,7 +26,7 @@ create table llx_const ( rowid integer AUTO_INCREMENT PRIMARY KEY, - name varchar(255) NOT NULL, + name varchar(180) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id value text NOT NULL, -- max 65535 caracteres type varchar(6), diff --git a/htdocs/install/mysql/tables/llx_element_tag.key.sql b/htdocs/install/mysql/tables/llx_element_tag.key.sql deleted file mode 100644 index cdf68b85484..00000000000 --- a/htdocs/install/mysql/tables/llx_element_tag.key.sql +++ /dev/null @@ -1,20 +0,0 @@ --- ============================================================================ --- Copyright (C) 2012 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 3 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, see . --- --- ============================================================================ - - -ALTER TABLE llx_element_tag ADD UNIQUE INDEX uk_element_tag (entity, lang, tag, fk_element, element); diff --git a/htdocs/install/mysql/tables/llx_element_tag.sql b/htdocs/install/mysql/tables/llx_element_tag.sql deleted file mode 100644 index e561cde85e9..00000000000 --- a/htdocs/install/mysql/tables/llx_element_tag.sql +++ /dev/null @@ -1,29 +0,0 @@ --- ============================================================================ --- Copyright (C) 2012 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 3 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, see . --- --- =========================================================================== - -create table llx_element_tag -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - entity integer DEFAULT 1 NOT NULL, -- multi company id - lang varchar(5) NOT NULL, - tag varchar(255) NOT NULL, - fk_element integer NOT NULL, - element varchar(64) NOT NULL - -)ENGINE=innodb; - diff --git a/htdocs/install/mysql/tables/llx_facture_fourn.key.sql b/htdocs/install/mysql/tables/llx_facture_fourn.key.sql index 7130640a9f0..cbea87a398f 100644 --- a/htdocs/install/mysql/tables/llx_facture_fourn.key.sql +++ b/htdocs/install/mysql/tables/llx_facture_fourn.key.sql @@ -1,5 +1,5 @@ -- ============================================================================ --- Copyright (C) 2005 Laurent Destailleur +-- Copyright (C) 2005-2017 Laurent Destailleur -- Copyright (C) 2005-2009 Regis Houssin -- -- This program is free software; you can redistribute it and/or modify diff --git a/htdocs/install/mysql/tables/llx_facture_fourn.sql b/htdocs/install/mysql/tables/llx_facture_fourn.sql index 89d0ddc9478..b1329de08ac 100644 --- a/htdocs/install/mysql/tables/llx_facture_fourn.sql +++ b/htdocs/install/mysql/tables/llx_facture_fourn.sql @@ -1,6 +1,6 @@ -- =========================================================================== -- Copyright (C) 2001-2003 Rodolphe Quiedeville --- Copyright (C) 2007 Laurent Destailleur +-- Copyright (C) 2007-2017 Laurent Destailleur -- Copyright (C) 2007-2012 Regis Houssin -- Copyright (C) 2010 Juanjo Menent -- @@ -22,8 +22,8 @@ create table llx_facture_fourn ( rowid integer AUTO_INCREMENT PRIMARY KEY, - ref varchar(255) NOT NULL, - ref_supplier varchar(255) NOT NULL, + ref varchar(180) NOT NULL, + ref_supplier varchar(180) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id ref_ext varchar(255), -- reference into an external system (not used by dolibarr) diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 64dcebe4616..21da795cd4e 100755 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -1,6 +1,6 @@ -- ============================================================================ -- Copyright (C) 2002-2006 Rodolphe Quiedeville --- Copyright (C) 2008-2010 Laurent Destailleur +-- Copyright (C) 2008-2017 Laurent Destailleur -- Copyright (C) 2005-2010 Regis Houssin -- Copyright (C) 2010 Juanjo Menent -- Copyright (C) 2012-2013 Cédric Salvador @@ -62,7 +62,7 @@ create table llx_product duration varchar(6), seuil_stock_alerte integer DEFAULT NULL, url varchar(255), - barcode varchar(255) DEFAULT NULL, -- barcode + barcode varchar(180) DEFAULT NULL, -- barcode fk_barcode_type integer DEFAULT NULL, -- barcode type accountancy_code_sell varchar(32), -- Selling accountancy code accountancy_code_sell_intra varchar(32), -- Selling accountancy code for vat intracommunity diff --git a/htdocs/install/mysql/tables/llx_product_attribute_value.key.sql b/htdocs/install/mysql/tables/llx_product_attribute_value.key.sql index 889bba4615e..42763665d71 100644 --- a/htdocs/install/mysql/tables/llx_product_attribute_value.key.sql +++ b/htdocs/install/mysql/tables/llx_product_attribute_value.key.sql @@ -16,4 +16,4 @@ -- -- ============================================================================ -ALTER TABLE llx_product_attribute_value ADD CONSTRAINT unique_ref UNIQUE (fk_product_attribute,ref); \ No newline at end of file +ALTER TABLE llx_product_attribute_value ADD UNIQUE INDEX uk_product_attribute_value (fk_product_attribute, ref); diff --git a/htdocs/install/mysql/tables/llx_product_attribute_value.sql b/htdocs/install/mysql/tables/llx_product_attribute_value.sql index 8ca6888d91b..626f137789a 100644 --- a/htdocs/install/mysql/tables/llx_product_attribute_value.sql +++ b/htdocs/install/mysql/tables/llx_product_attribute_value.sql @@ -1,5 +1,6 @@ -- ============================================================================ -- Copyright (C) 2016 Marcos García +-- Copyright (C) 2017 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 @@ -20,7 +21,7 @@ CREATE TABLE llx_product_attribute_value ( rowid INT PRIMARY KEY NOT NULL AUTO_INCREMENT, fk_product_attribute INT NOT NULL, - ref VARCHAR(255) DEFAULT NULL, + ref VARCHAR(180) DEFAULT NULL, value VARCHAR(255) DEFAULT NULL, entity INT DEFAULT 1 NOT NULL )ENGINE=innodb; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index 4d74e411260..c23ca3a183c 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -1,6 +1,6 @@ -- ======================================================================== -- Copyright (C) 2000-2004 Rodolphe Quiedeville --- Copyright (C) 2004-2014 Laurent Destailleur +-- Copyright (C) 2004-2017 Laurent Destailleur -- Copyright (C) 2005-2010 Regis Houssin -- Copyright (C) 2010 Juanjo Menent -- Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> @@ -92,7 +92,7 @@ create table llx_societe localtax1_value double(6,3), localtax2_assuj tinyint DEFAULT 0, -- assujeti ou non a local tax 2 localtax2_value double(6,3), - barcode varchar(255), -- barcode + barcode varchar(180), -- barcode fk_barcode_type integer NULL DEFAULT 0, -- barcode type price_level integer NULL, -- level of price for multiprices outstanding_limit double(24,8) DEFAULT NULL, -- allowed outstanding limit diff --git a/htdocs/install/mysql/tables/llx_user_param.sql b/htdocs/install/mysql/tables/llx_user_param.sql index 67bce42645a..365f49b060d 100644 --- a/htdocs/install/mysql/tables/llx_user_param.sql +++ b/htdocs/install/mysql/tables/llx_user_param.sql @@ -1,6 +1,6 @@ -- ============================================================================ -- Copyright (C) 2004 Rodolphe Quiedeville --- Copyright (C) 2004-2009 Laurent Destailleur +-- Copyright (C) 2004-2017 Laurent Destailleur -- Copyright (C) 2005-2009 Regis Houssin -- -- This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ create table llx_user_param ( fk_user integer NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id - param varchar(255) NOT NULL, + param varchar(180) NOT NULL, value text NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_usergroup.sql b/htdocs/install/mysql/tables/llx_usergroup.sql index cc8501a5fcd..f82c21eae87 100644 --- a/htdocs/install/mysql/tables/llx_usergroup.sql +++ b/htdocs/install/mysql/tables/llx_usergroup.sql @@ -1,6 +1,6 @@ -- ============================================================================ -- Copyright (C) 2005 Rodolphe Quiedeville --- Copyright (C) 2005-2009 Laurent Destailleur +-- Copyright (C) 2005-2017 Laurent Destailleur -- Copyright (C) 2005-2009 Regis Houssin -- -- This program is free software; you can redistribute it and/or modify @@ -21,7 +21,7 @@ create table llx_usergroup ( rowid integer AUTO_INCREMENT PRIMARY KEY, - nom varchar(255) NOT NULL, + nom varchar(180) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id datec datetime, tms timestamp,