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