Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding valid options for sqlite collation. Tests added.
  • Loading branch information
markstory committed Oct 29, 2009
1 parent a334571 commit 2383154
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cake/libs/model/datasources/dbo/dbo_sqlite.php
Expand Up @@ -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'
)
),
);

/**
Expand Down
12 changes: 12 additions & 0 deletions cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 2383154

Please sign in to comment.