Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.
Permalink
Browse files
Allow changeColumn() in migration to set 'notnull' to false.
  • 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.
@@ -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.