diff --git a/lib/Cake/Model/Datasource/Database/Mysql.php b/lib/Cake/Model/Datasource/Database/Mysql.php index 5474880127c..34252256be1 100644 --- a/lib/Cake/Model/Datasource/Database/Mysql.php +++ b/lib/Cake/Model/Datasource/Database/Mysql.php @@ -88,7 +88,7 @@ class Mysql extends DboSource { 'collate' => array('value' => 'COLLATE', 'quote' => false, 'join' => ' ', 'column' => 'Collation', 'position' => 'beforeDefault'), 'comment' => array('value' => 'COMMENT', 'quote' => true, 'join' => ' ', 'column' => 'Comment', 'position' => 'afterDefault'), 'unsigned' => array( - 'value' => 'UNSIGNED', 'quote' => false, 'join' => ' ', 'column' => false, 'position' => 'afterDefault', + 'value' => 'UNSIGNED', 'quote' => false, 'join' => ' ', 'column' => false, 'position' => 'beforeDefault', 'noVal' => true, 'options' => array(true), 'types' => array('integer', 'float', 'biginteger', 'numeric') diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php index 2da1707ad75..43c38094f16 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php @@ -3253,6 +3253,16 @@ public function buildColumnUnsignedProvider() { 'unsigned' => true ), '`testName` decimal UNSIGNED' + ), + //set #7 + array( + array( + 'name' => 'testName', + 'type' => 'numeric', + 'unsigned' => true, + 'default' => 1 + ), + '`testName` decimal UNSIGNED DEFAULT 1' ) ); }