Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #32 from LeoOnTheEarth/patch-2
Browse files Browse the repository at this point in the history
fix bug when "DEFAULT" is 0 or "" (an empty string)
  • Loading branch information
asika32764 committed Mar 11, 2016
2 parents fc94679 + 27f4f0a commit d0c374f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Sqlsync/Importer/YamlImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function addTable($table)
}
else
{
$default = isset($column['Default']) ? ' DEFAULT ' . $this->db->quote($column['Default']) : '';
$default = is_null($column['Default']) ? '' : ' DEFAULT ' . $this->db->quote($column['Default']);
}

$addColumns[] = "{$this->db->quoteName($column['Field'])} {$column['Type']}{$null}{$default}{$ai}{$comment}";
Expand Down Expand Up @@ -320,7 +320,7 @@ protected function addColumn($tableName, $columnName, $before, $column)
}
else
{
$default = $column['Default'] ? ' DEFAULT ' . $this->db->quote($column['Default']) : '';
$default = is_null($column['Default']) ? '' : ' DEFAULT ' . $this->db->quote($column['Default']);
}

// Build sql
Expand Down

0 comments on commit d0c374f

Please sign in to comment.