| @@ 380-394 (lines=15) @@ | ||
| 377 | /** |
|
| 378 | * {@inheritdoc} |
|
| 379 | */ |
|
| 380 | public function addColumn(Table $table, Column $column) |
|
| 381 | { |
|
| 382 | $sql = sprintf( |
|
| 383 | 'ALTER TABLE %s ADD %s %s', |
|
| 384 | $this->quoteTableName($table->getName()), |
|
| 385 | $this->quoteColumnName($column->getName()), |
|
| 386 | $this->getColumnSqlDefinition($column) |
|
| 387 | ); |
|
| 388 | ||
| 389 | if ($column->getAfter()) { |
|
| 390 | $sql .= ' AFTER ' . $this->quoteColumnName($column->getAfter()); |
|
| 391 | } |
|
| 392 | ||
| 393 | $this->execute($sql); |
|
| 394 | } |
|
| 395 | ||
| 396 | /** |
|
| 397 | * {@inheritdoc} |
|
| @@ 433-446 (lines=14) @@ | ||
| 430 | /** |
|
| 431 | * {@inheritdoc} |
|
| 432 | */ |
|
| 433 | public function changeColumn($tableName, $columnName, Column $newColumn) |
|
| 434 | { |
|
| 435 | $after = $newColumn->getAfter() ? ' AFTER ' . $this->quoteColumnName($newColumn->getAfter()) : ''; |
|
| 436 | $this->execute( |
|
| 437 | sprintf( |
|
| 438 | 'ALTER TABLE %s CHANGE %s %s %s%s', |
|
| 439 | $this->quoteTableName($tableName), |
|
| 440 | $this->quoteColumnName($columnName), |
|
| 441 | $this->quoteColumnName($newColumn->getName()), |
|
| 442 | $this->getColumnSqlDefinition($newColumn), |
|
| 443 | $after |
|
| 444 | ) |
|
| 445 | ); |
|
| 446 | } |
|
| 447 | ||
| 448 | /** |
|
| 449 | * {@inheritdoc} |
|