Fix sql syntax error

This commit is contained in:
Laurent Destailleur 2017-08-26 20:16:12 +02:00
parent 49a2f4f0c6
commit 03eb870576
3 changed files with 4 additions and 5 deletions

View File

@ -189,7 +189,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
// Add line buf to buffer if not a comment
if (! preg_match('/^--/',$buf))
{
$buf=preg_replace('/([,;])\s*--.*$/','\1',$buf); //remove comment from a line that not start with -- before add it to the buffer
$buf=preg_replace('/([,;ERLT\)])\s*--.*$/i','\1',$buf); //remove comment from a line that not start with -- before add it to the buffer
$buffer .= trim($buf);
}

View File

@ -45,12 +45,12 @@ CREATE TABLE llx_accounting_bookkeeping
fk_user_modif integer, -- | user making last change
date_creation datetime, -- FEC:EcritureDate | creation date
tms timestamp, -- | date last modification
fk_user integer NULL -- The id of user that validate the accounting source document
fk_user integer NULL, -- The id of user that validate the accounting source document
code_journal varchar(32) NOT NULL, -- FEC:JournalCode
journal_label varchar(255), -- FEC:JournalLib
piece_num integer NOT NULL, -- FEC:EcritureNum | accounting source document
validated tinyint DEFAULT 0 NOT NULL, -- | 0 line not validated / 1 line validated (No deleting / No modification)
date_validated datetime -- FEC:ValidDate
date_validated datetime, -- FEC:ValidDate
import_key varchar(14),
extraparams varchar(255) -- for other parameters with json format
) ENGINE=innodb;

View File

@ -23,7 +23,6 @@ create table llx_extrafields
name varchar(64) NOT NULL, -- name of field into extrafields tables
entity integer DEFAULT 1 NOT NULL, -- multi company id
elementtype varchar(64) NOT NULL DEFAULT 'member', -- for which element this extra fields is for
tms timestamp, -- date of last update
label varchar(255) NOT NULL, -- label to show for attribute
type varchar(8),
size varchar(8) DEFAULT NULL,
@ -41,5 +40,5 @@ create table llx_extrafields
fk_user_author integer, -- user making creation
fk_user_modif integer, -- user making last change
datec datetime, -- date de creation
tms timestamp
tms timestamp -- date of last update
)ENGINE=innodb;