Skip to content

Commit 2383154

Browse files
committed
Adding valid options for sqlite collation. Tests added.
1 parent a334571 commit 2383154

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

cake/libs/model/datasources/dbo/dbo_sqlite.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,16 @@ class DboSqlite extends DboSource {
114114
* @access public
115115
*/
116116
var $fieldParameters = array(
117-
'collate' => array('value' => 'COLLATE', 'quote' => false, 'join' => ' ', 'column' => 'Collate', 'position' => 'afterDefault'),
117+
'collate' => array(
118+
'value' => 'COLLATE',
119+
'quote' => false,
120+
'join' => ' ',
121+
'column' => 'Collate',
122+
'position' => 'afterDefault',
123+
'options' => array(
124+
'BINARY', 'NOCASE', 'RTRIM'
125+
)
126+
),
118127
);
119128

120129
/**

cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,18 @@ function testBuildColumn() {
280280
$result = $this->db->buildColumn($data);
281281
$expected = '"testName" integer(10) DEFAULT \'10\' NOT NULL';
282282
$this->assertEqual($result, $expected);
283+
284+
$data = array(
285+
'name' => 'testName',
286+
'type' => 'integer',
287+
'length' => 10,
288+
'default' => 10,
289+
'null' => false,
290+
'collate' => 'BADVALUE'
291+
);
292+
$result = $this->db->buildColumn($data);
293+
$expected = '"testName" integer(10) DEFAULT \'10\' NOT NULL';
294+
$this->assertEqual($result, $expected);
283295
}
284296

285297
/**

0 commit comments

Comments
 (0)