Add llx_c_ziptown for zip code and town

This commit is contained in:
Regis Houssin 2010-10-12 14:37:32 +00:00
parent 66c3bcd403
commit 5e80045105
3 changed files with 73 additions and 1 deletions

View File

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

View File

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

View File

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