diff --git a/htdocs/install/mysql/migration/2.9.0-3.0.0.sql b/htdocs/install/mysql/migration/2.9.0-3.0.0.sql index e46147b187953a2fafd0cac10b4c1ce82c6d256e..5f5708cc9fff306ee7e9484e4150ca538ea68212 100644 --- a/htdocs/install/mysql/migration/2.9.0-3.0.0.sql +++ b/htdocs/install/mysql/migration/2.9.0-3.0.0.sql @@ -79,4 +79,20 @@ ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX idx_ecm_directories (label, fk_ ALTER TABLE llx_ecm_documents ADD UNIQUE INDEX idx_ecm_documents (fullpath_dol); --Add modules facture fournisseur -insert into llx_const (name, value, type, note, visible) values ('INVOICE_SUPPLIER_ADDON_PDF', 'canelle','chaine','',0); \ No newline at end of file +insert into llx_const (name, value, type, note, visible) values ('INVOICE_SUPPLIER_ADDON_PDF', 'canelle','chaine','',0); + +create table llx_c_ziptown +( + rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, + code varchar(5) DEFAULT NULL, + fk_country integer NOT NULL, + fk_county integer NOT NULL, + zip varchar(10) NOT NULL, + town varchar(255) NOT NULL, + active tinyint NOT NULL DEFAULT 1 +)type=innodb; + +ALTER TABLE llx_c_ziptown ADD INDEX idx_c_ziptown_fk_country (fk_country); +ALTER TABLE llx_c_ziptown ADD INDEX idx_c_ziptown_fk_county (fk_county); +ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_country FOREIGN KEY (fk_country) REFERENCES llx_c_pays (rowid); +ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_county FOREIGN KEY (fk_county) REFERENCES llx_c_departements (rowid); \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_c_ziptown.key.sql b/htdocs/install/mysql/tables/llx_c_ziptown.key.sql new file mode 100644 index 0000000000000000000000000000000000000000..df424327478c68b86383464325cecb4bc2c33643 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_ziptown.key.sql @@ -0,0 +1,26 @@ +-- ======================================================================== +-- Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr> +-- +-- 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_c_ziptown ADD INDEX idx_c_ziptown_fk_country (fk_country); +ALTER TABLE llx_c_ziptown ADD INDEX idx_c_ziptown_fk_county (fk_county); + +ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_country FOREIGN KEY (fk_country) REFERENCES llx_c_pays (rowid); +ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_county FOREIGN KEY (fk_county) REFERENCES llx_c_departements (rowid); \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_c_ziptown.sql b/htdocs/install/mysql/tables/llx_c_ziptown.sql new file mode 100644 index 0000000000000000000000000000000000000000..afe82644fb3ec07d467a6de1f44105047811ffd4 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_ziptown.sql @@ -0,0 +1,30 @@ +-- ======================================================================== +-- Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr> +-- +-- 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_c_ziptown +( + rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, + code varchar(5) DEFAULT NULL, -- ex: code insee pour la France + fk_country integer NOT NULL, -- Country id in llx_c_pays + fk_county integer NOT NULL, -- County id in llx_c_departements + zip varchar(10) NOT NULL, -- Zip code + town varchar(255) NOT NULL, -- Town name + active tinyint NOT NULL DEFAULT 1 +)type=innodb;