Skip to content

Commit

Permalink
Merge pull request #65 from owncloud/fix_psql_migration
Browse files Browse the repository at this point in the history
fix drop default on postgresql when default value is removed
  • Loading branch information
DeepDiver1975 committed Dec 12, 2013
2 parents ce6cd97 + 12d8399 commit 0097fce
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,9 @@ public function getAlterTableSQL(TableDiff $diff)
}

if ($columnDiff->hasChanged('default')) {
$query = 'ALTER ' . $oldColumnName . ' SET ' . $this->getDefaultValueDeclarationSQL($column->toArray());
$query = 'ALTER ' . $oldColumnName . ((null !== $column->getDefault())
? ' SET ' . $this->getDefaultValueDeclarationSQL($column->toArray())
: ' DROP DEFAULT');
$sql[] = 'ALTER TABLE ' . $diff->name . ' ' . $query;
}

Expand Down

0 comments on commit 0097fce

Please sign in to comment.