diff --git a/mysql/tables/llx_c_departements.key.sql b/mysql/tables/llx_c_departements.key.sql new file mode 100644 index 00000000000..a14427cfd8d --- /dev/null +++ b/mysql/tables/llx_c_departements.key.sql @@ -0,0 +1,26 @@ +-- ============================================================================ +-- Copyright (C) 2005 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 +-- 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$ +-- $Source$ +-- +-- ============================================================================ + + +ALTER TABLE llx_c_departements ADD UNIQUE uk_departements (code_departement,fk_region); + +ALTER TABLE llx_c_departements ADD INDEX idx_departements_fk_region (fk_region); diff --git a/mysql/tables/llx_c_departements.sql b/mysql/tables/llx_c_departements.sql index 8ea96334e0d..0b74a715128 100644 --- a/mysql/tables/llx_c_departements.sql +++ b/mysql/tables/llx_c_departements.sql @@ -30,9 +30,7 @@ create table llx_c_departements tncc integer, ncc varchar(50), nom varchar(50), - active tinyint DEFAULT 1 NOT NULL, - - key (fk_region) + active tinyint DEFAULT 1 NOT NULL )type=innodb; diff --git a/pgsql/tables/llx_c_departements.key.sql b/pgsql/tables/llx_c_departements.key.sql new file mode 100644 index 00000000000..ad0222d41a1 --- /dev/null +++ b/pgsql/tables/llx_c_departements.key.sql @@ -0,0 +1,30 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2005 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 +-- 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$ +-- $Source$ +-- +-- ============================================================================ + + +ALTER TABLE llx_c_departements ADD UNIQUE uk_departements (code_departement,fk_region); + +ALTER TABLE llx_c_departements ADD INDEX idx_departements_fk_region (fk_region); diff --git a/pgsql/tables/llx_c_departements.sql b/pgsql/tables/llx_c_departements.sql index fed2ec4875a..9821327a93b 100644 --- a/pgsql/tables/llx_c_departements.sql +++ b/pgsql/tables/llx_c_departements.sql @@ -25,7 +25,6 @@ -- -- ======================================================================== - create table llx_c_departements ( rowid SERIAL PRIMARY KEY, @@ -38,7 +37,5 @@ create table llx_c_departements "active" smallint DEFAULT 1 NOT NULL ); -CREATE INDEX idx_llx_c_departements_fk_region ON llx_c_departements (fk_region); - diff --git a/pgsql/tables/llx_c_regions.key.sql b/pgsql/tables/llx_c_regions.key.sql index 32d7f0d561c..fdd71624346 100644 --- a/pgsql/tables/llx_c_regions.key.sql +++ b/pgsql/tables/llx_c_regions.key.sql @@ -25,4 +25,5 @@ -- ======================================================================== -ALTER TABLE llx_c_regions ADD CONSTRAINT c_regions_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_pays (rowid); +ALTER TABLE llx_c_regions ADD INDEX idx_c_regions_fk_pays (fk_pays); +ALTER TABLE llx_c_regions ADD CONSTRAINT c_regions_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_pays (rowid);