2
0
forked from Wavyzz/dolibarr

Fix field name and length (database portabilit)

This commit is contained in:
Laurent Destailleur
2017-12-28 11:16:27 +01:00
parent 6676178435
commit ce680af357
19 changed files with 29 additions and 71 deletions

View File

@@ -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;

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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;

View File

@@ -2,6 +2,7 @@
-- Copyright (C) 2005 Brice Davoleau <e1davole@iu-vannes.fr>
-- Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
-- Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
-- Copyright (C) 2017 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
@@ -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

View File

@@ -1,6 +1,7 @@
-- ===================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
-- Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
--
-- This program is free software; you can redistribute it and/or modify

View File

@@ -1,7 +1,7 @@
-- ===================================================================
-- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
-- Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
--
-- 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)

View File

@@ -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),

View File

@@ -1,20 +0,0 @@
-- ============================================================================
-- Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
--
-- 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 <http://www.gnu.org/licenses/>.
--
-- ============================================================================
ALTER TABLE llx_element_tag ADD UNIQUE INDEX uk_element_tag (entity, lang, tag, fk_element, element);

View File

@@ -1,29 +0,0 @@
-- ============================================================================
-- Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
--
-- 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 <http://www.gnu.org/licenses/>.
--
-- ===========================================================================
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;

View File

@@ -1,5 +1,5 @@
-- ============================================================================
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
--
-- This program is free software; you can redistribute it and/or modify

View File

@@ -1,6 +1,6 @@
-- ===========================================================================
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2007-2012 Regis Houssin <regis.houssin@capnetworks.com>
-- Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
--
@@ -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)

View File

@@ -1,6 +1,6 @@
-- ============================================================================
-- Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2008-2017 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
-- Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
-- Copyright (C) 2012-2013 Cédric Salvador <csalvador@gpcsolutions.fr>
@@ -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

View File

@@ -16,4 +16,4 @@
--
-- ============================================================================
ALTER TABLE llx_product_attribute_value ADD CONSTRAINT unique_ref UNIQUE (fk_product_attribute,ref);
ALTER TABLE llx_product_attribute_value ADD UNIQUE INDEX uk_product_attribute_value (fk_product_attribute, ref);

View File

@@ -1,5 +1,6 @@
-- ============================================================================
-- Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
-- Copyright (C) 2017 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
@@ -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;

View File

@@ -1,6 +1,6 @@
-- ========================================================================
-- Copyright (C) 2000-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
-- Copyright (C) 2010 Juanjo Menent <dolibarr@2byte.es>
-- 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

View File

@@ -1,6 +1,6 @@
-- ============================================================================
-- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
--
-- 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;

View File

@@ -1,6 +1,6 @@
-- ============================================================================
-- Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
--
-- 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,