|
@@ 299-303 (lines=5) @@
|
| 296 |
|
*/ |
| 297 |
|
public function addColumn($columnName, $type = null, $options = []) |
| 298 |
|
{ |
| 299 |
|
if ($columnName instanceof Column) { |
| 300 |
|
$action = new AddColumn($this->table, $columnName); |
| 301 |
|
} else { |
| 302 |
|
$action = AddColumn::build($this->table, $columnName, $type, $options); |
| 303 |
|
} |
| 304 |
|
|
| 305 |
|
// Delegate to Adapters to check column type |
| 306 |
|
if (!$this->getAdapter()->isValidColumnType($action->getColumn())) { |
|
@@ 358-362 (lines=5) @@
|
| 355 |
|
*/ |
| 356 |
|
public function changeColumn($columnName, $newColumnType, array $options = []) |
| 357 |
|
{ |
| 358 |
|
if ($newColumnType instanceof Column) { |
| 359 |
|
$action = new ChangeColumn($this->table, $columnName, $newColumnType); |
| 360 |
|
} else { |
| 361 |
|
$action = ChangeColumn::build($this->table, $columnName, $newColumnType, $options); |
| 362 |
|
} |
| 363 |
|
$this->actions->addAction($action); |
| 364 |
|
|
| 365 |
|
return $this; |