Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
okinaka committed Dec 11, 2014
1 parent 5cff6aa commit 8c008ad
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion lib/Cake/Model/Datasource/Database/Mysql.php
Expand Up @@ -353,7 +353,6 @@ public function describe($model) {
}
if ($fields[$column->Field]['type'] === 'timestamp' && strtoupper($column->Default) === 'CURRENT_TIMESTAMP') {
$fields[$column->Field]['default'] = null;
$fields[$column->Field]['null'] = true;
}
if (!empty($column->Key) && isset($this->index[$column->Key])) {
$fields[$column->Field]['key'] = $this->index[$column->Key];
Expand Down
3 changes: 1 addition & 2 deletions lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
Expand Up @@ -909,14 +909,13 @@ public function testDescribeHandleCurrentTimestamp() {
$this->Dbo->execute('DROP TABLE ' . $name);

$this->assertNull($result['limit_date']['default']);
$this->assertTrue($result['limit_date']['null']);

$schema = new CakeSchema(array(
'connection' => 'test',
'testdescribes' => $result
));
$result = $this->Dbo->createSchema($schema);
$this->assertContains('`limit_date` timestamp NULL,', $result);
$this->assertContains('`limit_date` timestamp NOT NULL,', $result);
}

/**
Expand Down

0 comments on commit 8c008ad

Please sign in to comment.