Skip to content

Commit

Permalink
Merge pull request #6302 from cakephp/issue-6230
Browse files Browse the repository at this point in the history
Accomodate older versions of SQLite.
  • Loading branch information
lorenzo committed Apr 9, 2015
2 parents c73495d + 8fe26ed commit d1a17c2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Database/Schema/SqliteSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,14 @@ public function describeForeignKeySql($tableName, $config)
*/
public function convertForeignKeyDescription(Table $table, $row)
{
$update = isset($row['on_update']) ? $row['on_update'] : '';
$delete = isset($row['on_delete']) ? $row['on_delete'] : '';
$data = [
'type' => Table::CONSTRAINT_FOREIGN,
'columns' => [$row['from']],
'references' => [$row['table'], $row['to']],
'update' => $this->_convertOnClause($row['on_update']),
'delete' => $this->_convertOnClause($row['on_delete']),
'update' => $this->_convertOnClause($update),
'delete' => $this->_convertOnClause($delete),
];
$name = $row['from'] . '_fk';
$table->addConstraint($name, $data);
Expand Down

0 comments on commit d1a17c2

Please sign in to comment.