From bef9fd152b1ae0641b21430b2e07e47d5ef26a37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Oct 2012 19:42:44 +0200 Subject: [PATCH] Fix: table creation scripts --- dev/initdata/initdemo.sh | 11 +++++----- .../install/mysql/migration/3.2.0-3.3.0.sql | 7 ++++++ .../mysql/tables/llx_accountingsystem.key.sql | 22 +++++++++++++++++++ 3 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 htdocs/install/mysql/tables/llx_accountingsystem.key.sql diff --git a/dev/initdata/initdemo.sh b/dev/initdata/initdemo.sh index fffcdd3f383..2d142b5465b 100755 --- a/dev/initdata/initdemo.sh +++ b/dev/initdata/initdemo.sh @@ -11,13 +11,14 @@ #------------------------------------------------------ -export dumpfile=`ls mysqldump_dolibarr_*.sql | sort | tail -n 1` export mydir=`echo "$0" | sed -e 's/initdemo.sh//'`; if [ "x$mydir" = "x" ] then export mydir="." fi export id=`id -u`; +export dumpfile=`ls $mydir/mysqldump_dolibarr_*.sql | sort | tail -n 1` +export dumpfile=`basename $dumpfile` # ----------------------------- check if root @@ -149,10 +150,10 @@ if [ "x$passwd" != "x" ] then export passwd="-p$passwd" fi -#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile" -#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile -echo "mysql -P$port -u$admin ***** $base < $mydir/$dumpfile" -mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile +#echo "mysql -P$port -u$admin -p$passwd $base < $mydir/$dumpfile" +#mysql -P$port -u$admin -p$passwd $base < $mydir/$dumpfile +echo "mysql -P$port -u$admin -p***** $base < $mydir/$dumpfile" +mysql -P$port -u$admin -p$passwd $base < $mydir/$dumpfile echo "Dolibarr data demo has been loaded." echo diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index bf6229c859f..a24f214bfcb 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -272,6 +272,8 @@ ALTER TABLE llx_c_tva DROP COLUMN accountancy_code; ALTER TABLE llx_c_tva ADD COLUMN accountancy_code_sell varchar(15) DEFAULT NULL AFTER active; ALTER TABLE llx_c_tva ADD COLUMN accountancy_code_buy varchar(15) DEFAULT NULL AFTER accountancy_code_sell; ALTER TABLE llx_c_chargessociales ADD COLUMN accountancy_code varchar(15) DEFAULT NULL AFTER code; + +-- Tables for accountancy expert DROP TABLE llx_accountingaccount; DROP TABLE llx_accountingsystem; @@ -284,6 +286,8 @@ create table llx_accountingsystem active smallint DEFAULT 0 )ENGINE=innodb; +ALTER TABLE llx_accountingsystem ADD INDEX idx_accountingsystem_pcg_version (pcg_version); + create table llx_accountingaccount ( rowid integer AUTO_INCREMENT PRIMARY KEY, @@ -299,6 +303,9 @@ create table llx_accountingaccount ALTER TABLE llx_accountingaccount ADD INDEX idx_accountingaccount_fk_pcg_version (fk_pcg_version); ALTER TABLE llx_accountingaccount ADD CONSTRAINT fk_accountingaccount_fk_pcg_version FOREIGN KEY (fk_pcg_version) REFERENCES llx_accountingsystem (pcg_version); + +-- Data for accountancy expert + insert into llx_accountingsystem (rowid, pcg_version, fk_pays, label, active) VALUES (1,'PCG99-ABREGE', 1, 'The simple accountancy french plan', 1); insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 1,'PCG99-ABREGE','CAPIT', 'CAPITAL', '101', '1', 'Capital', '1'); diff --git a/htdocs/install/mysql/tables/llx_accountingsystem.key.sql b/htdocs/install/mysql/tables/llx_accountingsystem.key.sql new file mode 100644 index 00000000000..07a60a29054 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_accountingsystem.key.sql @@ -0,0 +1,22 @@ +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- Copyright (C) 2005-2006 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, see . +-- +-- =========================================================================== + + +ALTER TABLE llx_accountingsystem ADD INDEX idx_accountingsystem_pcg_version (pcg_version); +