Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Commit

Permalink
Allow changeColumn() in migration to set 'notnull' to false.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Perrett authored and jwage committed Nov 3, 2010
1 parent 93f01b7 commit 58e74c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Doctrine/Export/Pgsql.php
Expand Up @@ -159,7 +159,7 @@ public function alterTableSql($name, array $changes, $check = false)
$query = 'ALTER ' . $fieldName . ' SET DEFAULT ' . $this->conn->quote($field['definition']['default'], $field['definition']['type']);
$sql[] = 'ALTER TABLE ' . $this->conn->quoteIdentifier($name, true) . ' ' . $query;
}
if ( ! empty($field['definition']['notnull'])) {
if ( isset($field['definition']['notnull'])) {
$query = 'ALTER ' . $fieldName . ' ' . ($field['definition']['notnull'] ? 'SET' : 'DROP') . ' NOT NULL';
$sql[] = 'ALTER TABLE ' . $this->conn->quoteIdentifier($name, true) . ' ' . $query;
}
Expand Down

0 comments on commit 58e74c5

Please sign in to comment.