diff --git a/mysql/migration/2.6.0-2.7.0.sql b/mysql/migration/2.6.0-2.7.0.sql index 6d58f71b015..0d56c66d893 100644 --- a/mysql/migration/2.6.0-2.7.0.sql +++ b/mysql/migration/2.6.0-2.7.0.sql @@ -57,6 +57,7 @@ ALTER TABLE llx_c_barcode_type ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTE ALTER TABLE llx_dolibarr_modules ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER numero; ALTER TABLE llx_bank_categ ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER label; ALTER TABLE llx_bordereau_cheque ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER number; +ALTER TABLE llx_prelevement_bons ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER ref; ALTER TABLE llx_rights_def DROP PRIMARY KEY; ALTER TABLE llx_user_param DROP INDEX fk_user; @@ -80,6 +81,7 @@ ALTER TABLE llx_livraison DROP INDEX idx_expedition_uk_ref; ALTER TABLE llx_livraison DROP INDEX idx_livraison_uk_ref; ALTER TABLE llx_fichinter DROP INDEX ref; ALTER TABLE llx_dolibarr_modules DROP PRIMARY KEY; +ALTER TABLE llx_prelevement_bons DROP INDEX ref; ALTER TABLE llx_rights_def ADD PRIMARY KEY (id, entity); ALTER TABLE llx_user_param ADD UNIQUE INDEX uk_user_param (fk_user,param,entity); @@ -105,6 +107,7 @@ ALTER TABLE llx_fichinter ADD UNIQUE INDEX uk_fichinter_ref (ref, entity); ALTER TABLE llx_contrat ADD UNIQUE INDEX uk_contrat_ref (ref, entity); ALTER TABLE llx_dolibarr_modules ADD PRIMARY KEY pk_dolibarr_modules (numero, entity); ALTER TABLE llx_bordereau_cheque ADD UNIQUE INDEX uk_bordereau_cheque (number, entity); +ALTER TABLE llx_prelevement_bons ADD UNIQUE INDEX uk_prelevement_bons_ref (ref, entity); UPDATE llx_const SET entity=0 WHERE name='MAIN_MODULE_USER' AND entity=1; UPDATE llx_const SET entity=0 WHERE name='MAIN_POPUP_CALENDAR' AND entity=1; diff --git a/mysql/tables/llx_prelevement_bons.key.sql b/mysql/tables/llx_prelevement_bons.key.sql new file mode 100644 index 00000000000..8bb011f7280 --- /dev/null +++ b/mysql/tables/llx_prelevement_bons.key.sql @@ -0,0 +1,23 @@ +-- ============================================================================ +-- Copyright (C) 2009 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 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_prelevement_bons ADD UNIQUE INDEX uk_prelevement_bons_ref (ref, entity); + diff --git a/mysql/tables/llx_prelevement_bons.sql b/mysql/tables/llx_prelevement_bons.sql index f66c5068e51..7e626be7349 100644 --- a/mysql/tables/llx_prelevement_bons.sql +++ b/mysql/tables/llx_prelevement_bons.sql @@ -1,5 +1,6 @@ -- =================================================================== --- Copyright (C) 2005 Rodolphe Quiedeville +-- Copyright (C) 2005 Rodolphe Quiedeville +-- Copyright (C) 2005-2009 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 @@ -28,6 +29,7 @@ create table llx_prelevement_bons ( rowid integer AUTO_INCREMENT PRIMARY KEY, ref varchar(12), -- reference + entity integer DEFAULT 1 NOT NULL, -- multi company id datec datetime, -- date de creation amount real DEFAULT 0, -- montant total du prélèvement statut smallint DEFAULT 0, -- statut @@ -37,7 +39,6 @@ create table llx_prelevement_bons method_trans smallint, -- méthode de transmission fk_user_trans integer, -- user qui a effectué la transmission date_credit datetime, -- date de crédit sur le compte - fk_user_credit integer, -- user qui a remonté l'info de crédit - - UNIQUE(ref) + fk_user_credit integer -- user qui a remonté l'info de crédit + )type=innodb;