Skip to content

Commit

Permalink
Add dropColumnByName method
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Apr 17, 2015
1 parent d14e18d commit 937a4f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/SQLBuilder/Universal/Query/AlterTableQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ public function addColumn(Column $toColumn)
return $spec;
}


public function dropColumnByName($columnName)
{
$column = new Column($columnName);
return $this->dropColumn($column);
}

public function dropColumn($column)
{
if (is_string($column)) {
Expand Down
2 changes: 1 addition & 1 deletion src/SQLBuilder/Universal/Syntax/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ public function buildAutoIncrementClause(BaseDriver $driver)
if ($this->autoIncrement) {
if ($driver instanceof SQLiteDriver) {
return ' AUTOINCREMENT';
} elseif ($driver instanceof MySQLDriver) {
} else if ($driver instanceof MySQLDriver) {
return ' AUTO_INCREMENT';
}
}
Expand Down

0 comments on commit 937a4f6

Please sign in to comment.