diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 0277f7e996b..4d3658d20bb 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -337,3 +337,8 @@ drop table tmp_c_shipment_mode; -- VMYSQL4.1 update llx_expensereport_det as ed set date = (select date_debut from llx_expensereport as e where ed.fk_expensereport = e.rowid) where DATE(STR_TO_DATE(date, '%Y-%m-%d')) < '1000-00-00'; -- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE'; + +-- Backport a change of value into the hourly rate. +-- update llx_projet_task_time as ptt set ptt.thm = (SELECT thm from llx_user as u where ptt.fk_user = u.rowid) where (ptt.thm is null) + + \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_advtargetemailing.sql b/htdocs/install/mysql/tables/llx_advtargetemailing.sql index d22503bb548..7e95f6b8097 100644 --- a/htdocs/install/mysql/tables/llx_advtargetemailing.sql +++ b/htdocs/install/mysql/tables/llx_advtargetemailing.sql @@ -28,4 +28,4 @@ CREATE TABLE llx_advtargetemailing datec datetime NOT NULL, fk_user_mod integer NOT NULL, tms timestamp NOT NULL -)ENGINE=InnoDB; +)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_product_attribute.sql b/htdocs/install/mysql/tables/llx_product_attribute.sql index 77c045327b8..cb655508e89 100644 --- a/htdocs/install/mysql/tables/llx_product_attribute.sql +++ b/htdocs/install/mysql/tables/llx_product_attribute.sql @@ -23,4 +23,4 @@ CREATE TABLE llx_product_attribute label VARCHAR(255) NOT NULL, rang INT DEFAULT 0 NOT NULL, entity INT DEFAULT 1 NOT NULL -); +)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_product_attribute_combination.sql b/htdocs/install/mysql/tables/llx_product_attribute_combination.sql index fae38f8403d..85c46706014 100644 --- a/htdocs/install/mysql/tables/llx_product_attribute_combination.sql +++ b/htdocs/install/mysql/tables/llx_product_attribute_combination.sql @@ -25,4 +25,4 @@ CREATE TABLE llx_product_attribute_combination variation_price_percentage INT NULL, variation_weight FLOAT NOT NULL, entity INT DEFAULT 1 NOT NULL -); \ No newline at end of file +)ENGINE=innodb; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_product_attribute_combination2val.sql b/htdocs/install/mysql/tables/llx_product_attribute_combination2val.sql index a64230923e6..af0da7f710d 100644 --- a/htdocs/install/mysql/tables/llx_product_attribute_combination2val.sql +++ b/htdocs/install/mysql/tables/llx_product_attribute_combination2val.sql @@ -22,4 +22,4 @@ CREATE TABLE llx_product_attribute_combination2val fk_prod_combination INT NOT NULL, fk_prod_attr INT NOT NULL, fk_prod_attr_val INT NOT NULL -); \ No newline at end of file +)ENGINE=innodb; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_product_attribute_value.sql b/htdocs/install/mysql/tables/llx_product_attribute_value.sql index ebd2cf8bb49..8ca6888d91b 100644 --- a/htdocs/install/mysql/tables/llx_product_attribute_value.sql +++ b/htdocs/install/mysql/tables/llx_product_attribute_value.sql @@ -23,4 +23,4 @@ CREATE TABLE llx_product_attribute_value ref VARCHAR(255) DEFAULT NULL, value VARCHAR(255) DEFAULT NULL, entity INT DEFAULT 1 NOT NULL -); \ No newline at end of file +)ENGINE=innodb; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_product_pricerules.sql b/htdocs/install/mysql/tables/llx_product_pricerules.sql index 3e3dfc02ed1..3cf58c9585f 100644 --- a/htdocs/install/mysql/tables/llx_product_pricerules.sql +++ b/htdocs/install/mysql/tables/llx_product_pricerules.sql @@ -23,4 +23,4 @@ CREATE TABLE llx_product_pricerules fk_level INT NOT NULL, -- Price variations are made over price of X var_percent FLOAT NOT NULL, -- Price variation over based price var_min_percent FLOAT NOT NULL -- Min price discount over general price -); \ No newline at end of file +)ENGINE=innodb; diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index c6123df3e77..c56f76af246 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -143,16 +143,16 @@ class CodingSqlTest extends PHPUnit_Framework_TestCase $listofsqldir = array(DOL_DOCUMENT_ROOT.'/install/mysql/tables', DOL_DOCUMENT_ROOT.'/install/mysql/migration'); - foreach ($listofsqldir as $dir) + foreach ($listofsqldir as $dir) { print 'Process dir '.$dir."\n"; $filesarray = scandir($dir); - - foreach($filesarray as $key => $file) + + foreach($filesarray as $key => $file) { if (! preg_match('/\.sql$/',$file)) continue; - + print 'Check sql file '.$file."\n"; $filecontent=file_get_contents($dir.'/'.$file); @@ -167,7 +167,7 @@ class CodingSqlTest extends PHPUnit_Framework_TestCase $result=strpos($filecontent,'ON DELETE CASCADE'); print __METHOD__." Result for checking we don't have 'ON DELETE CASCADE' = ".$result."\n"; $this->assertTrue($result===false, 'Found ON DELETE CASCADE into '.$file.'. Bad.'); - + if ($dir == DOL_DOCUMENT_ROOT.'/install/mysql/migration') { // Test for migration files only @@ -176,16 +176,20 @@ class CodingSqlTest extends PHPUnit_Framework_TestCase else { if (preg_match('/\.key\.sql$/',$file)) - { - // Test for files key files only - + { + // Test for key files only + } else { - // Test for files non key files only + // Test for non key files only $result=(strpos($filecontent,'KEY ') && strpos($filecontent,'PRIMARY KEY ') == 0); print __METHOD__." Result for checking we don't have ' KEY ' instead of a sql file to create index = ".$result."\n"; $this->assertTrue($result===false, 'Found KEY into '.$file.'. Bad.'); + + $result=stripos($filecontent,'ENGINE=innodb'); + print __METHOD__." Result for checking we have the ENGINE=innodb string = ".$result."\n"; + $this->assertGreaterThan(0, $result, 'The ENGINE=innodb was not found into '.$file.'. Add it or just fix syntax to match case.'); } } }