Browse Source

add decimal type for unsigned

imsamurai 12 years ago
parent
commit
f1a2c1a75c

+ 1 - 1
lib/Cake/Model/Datasource/Database/Mysql.php

@@ -91,7 +91,7 @@ class Mysql extends DboSource {
 			'value' => 'UNSIGNED', 'quote' => false, 'join' => ' ', 'column' => false, 'position' => 'beforeDefault',
 			'noVal' => true,
 			'options' => array(true),
-			'types' => array('integer', 'float', 'biginteger', 'numeric')
+			'types' => array('integer', 'float', 'biginteger', 'numeric', 'decimal')
 		)
 	);
 

+ 9 - 0
lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php

@@ -3262,6 +3262,15 @@ class MysqlTest extends CakeTestCase {
 					'default' => 1
 				),
 				'`testName` decimal UNSIGNED DEFAULT 1'
+			),
+			//set #8
+			array(
+				array(
+					'name' => 'testName',
+					'type' => 'decimal',
+					'unsigned' => true
+				),
+				'`testName` decimal UNSIGNED'
 			)
 		);
 	}