Skip to content
Browse files

Adding valid options for sqlite collation. Tests added.

  • Loading branch information...
1 parent a334571 commit 23831546b5da31ff21bb1d0c121d0098db7511f2 @markstory markstory committed
View
11 cake/libs/model/datasources/dbo/dbo_sqlite.php
@@ -114,7 +114,16 @@ class DboSqlite extends DboSource {
* @access public
*/
var $fieldParameters = array(
- 'collate' => array('value' => 'COLLATE', 'quote' => false, 'join' => ' ', 'column' => 'Collate', 'position' => 'afterDefault'),
+ 'collate' => array(
+ 'value' => 'COLLATE',
+ 'quote' => false,
+ 'join' => ' ',
+ 'column' => 'Collate',
+ 'position' => 'afterDefault',
+ 'options' => array(
+ 'BINARY', 'NOCASE', 'RTRIM'
+ )
+ ),
);
/**
View
12 cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php
@@ -280,6 +280,18 @@ function testBuildColumn() {
$result = $this->db->buildColumn($data);
$expected = '"testName" integer(10) DEFAULT \'10\' NOT NULL';
$this->assertEqual($result, $expected);
+
+ $data = array(
+ 'name' => 'testName',
+ 'type' => 'integer',
+ 'length' => 10,
+ 'default' => 10,
+ 'null' => false,
+ 'collate' => 'BADVALUE'
+ );
+ $result = $this->db->buildColumn($data);
+ $expected = '"testName" integer(10) DEFAULT \'10\' NOT NULL';
+ $this->assertEqual($result, $expected);
}
/**

0 comments on commit 2383154

Please sign in to comment.
Something went wrong with that request. Please try again.