Permalink
Browse files

Allow changeColumn() in migration to set 'notnull' to false.

  • Loading branch information...
Dave Perrett authored and jwage committed Nov 2, 2010
1 parent 93f01b7 commit 58e74c509ccb7cf6078ae98c0e11df46ad1af52f
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Doctrine/Export/Pgsql.php
@@ -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;
}

0 comments on commit 58e74c5

Please sign in to comment.