Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Code review comments.
  • Loading branch information
markstory committed Jun 6, 2013
1 parent fdeec5e commit 9dbeae0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
3 changes: 1 addition & 2 deletions lib/Cake/Database/Schema/Collection.php
Expand Up @@ -119,8 +119,7 @@ public function describe($name) {
*/
protected function _executeSql($sql, $params) {
try {
$statement = $this->_connection->execute($sql, $params);
return $statement;
return $this->_connection->execute($sql, $params);
} catch (\PDOException $e) {
throw new Exception($e->getMessage(), 500, $e);
}
Expand Down
4 changes: 1 addition & 3 deletions lib/Cake/Database/Schema/SqliteSchema.php
Expand Up @@ -231,9 +231,7 @@ protected function _convertOnClause($clause) {
if ($clause === 'NO ACTION') {
return 'none';
}
if ($clause === 'SET NULL') {
return null;
}
return null;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Database/Schema/Table.php
Expand Up @@ -93,8 +93,8 @@ class Table {
'columns' => [],
'length' => [],
'references' => [],
'update' => 'cascade',
'delete' => 'cascade',
'update' => 'restrict',
'delete' => 'restrict',
];

/**
Expand Down
14 changes: 10 additions & 4 deletions lib/Cake/Test/TestCase/Database/Schema/SqliteSchemaTest.php
Expand Up @@ -477,25 +477,31 @@ public static function constraintSqlProvider() {
'author_id_idx',
['type' => 'foreign', 'columns' => ['author_id'], 'references' => ['authors', 'id']],
'CONSTRAINT "author_id_idx" FOREIGN KEY ("author_id") ' .
'REFERENCES "authors" ("id") ON UPDATE CASCADE ON DELETE CASCADE'
'REFERENCES "authors" ("id") ON UPDATE RESTRICT ON DELETE RESTRICT'
],
[
'author_id_idx',
['type' => 'foreign', 'columns' => ['author_id'], 'references' => ['authors', 'id'], 'update' => 'cascade'],
'CONSTRAINT "author_id_idx" FOREIGN KEY ("author_id") ' .
'REFERENCES "authors" ("id") ON UPDATE CASCADE ON DELETE RESTRICT'
],
[
'author_id_idx',
['type' => 'foreign', 'columns' => ['author_id'], 'references' => ['authors', 'id'], 'update' => 'restrict'],
'CONSTRAINT "author_id_idx" FOREIGN KEY ("author_id") ' .
'REFERENCES "authors" ("id") ON UPDATE RESTRICT ON DELETE CASCADE'
'REFERENCES "authors" ("id") ON UPDATE RESTRICT ON DELETE RESTRICT'
],
[
'author_id_idx',
['type' => 'foreign', 'columns' => ['author_id'], 'references' => ['authors', 'id'], 'update' => null],
'CONSTRAINT "author_id_idx" FOREIGN KEY ("author_id") ' .
'REFERENCES "authors" ("id") ON UPDATE SET NULL ON DELETE CASCADE'
'REFERENCES "authors" ("id") ON UPDATE SET NULL ON DELETE RESTRICT'
],
[
'author_id_idx',
['type' => 'foreign', 'columns' => ['author_id'], 'references' => ['authors', 'id'], 'update' => 'none'],
'CONSTRAINT "author_id_idx" FOREIGN KEY ("author_id") ' .
'REFERENCES "authors" ("id") ON UPDATE NO ACTION ON DELETE CASCADE'
'REFERENCES "authors" ("id") ON UPDATE NO ACTION ON DELETE RESTRICT'
],
];
}
Expand Down

0 comments on commit 9dbeae0

Please sign in to comment.