| @@ 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} |
|
| @@ 434-447 (lines=14) @@ | ||
| 431 | /** |
|
| 432 | * {@inheritdoc} |
|
| 433 | */ |
|
| 434 | public function changeColumn($tableName, $columnName, Column $newColumn) |
|
| 435 | { |
|
| 436 | $after = $newColumn->getAfter() ? ' AFTER ' . $this->quoteColumnName($newColumn->getAfter()) : ''; |
|
| 437 | $this->execute( |
|
| 438 | sprintf( |
|
| 439 | 'ALTER TABLE %s CHANGE %s %s %s%s', |
|
| 440 | $this->quoteTableName($tableName), |
|
| 441 | $this->quoteColumnName($columnName), |
|
| 442 | $this->quoteColumnName($newColumn->getName()), |
|
| 443 | $this->getColumnSqlDefinition($newColumn), |
|
| 444 | $after |
|
| 445 | ) |
|
| 446 | ); |
|
| 447 | } |
|
| 448 | ||
| 449 | /** |
|
| 450 | * {@inheritdoc} |
|
| @@ 398-412 (lines=15) @@ | ||
| 395 | /** |
|
| 396 | * {@inheritdoc} |
|
| 397 | */ |
|
| 398 | public function addColumn(Table $table, Column $column) |
|
| 399 | { |
|
| 400 | $sql = sprintf( |
|
| 401 | 'ALTER TABLE %s ADD %s %s;', |
|
| 402 | $this->quoteTableName($table->getName()), |
|
| 403 | $this->quoteColumnName($column->getName()), |
|
| 404 | $this->getColumnSqlDefinition($column) |
|
| 405 | ); |
|
| 406 | ||
| 407 | if ($column->getComment()) { |
|
| 408 | $sql .= $this->getColumnCommentSqlDefinition($column, $table->getName()); |
|
| 409 | } |
|
| 410 | ||
| 411 | $this->execute($sql); |
|
| 412 | } |
|
| 413 | ||
| 414 | /** |
|
| 415 | * {@inheritdoc} |
|