| @@ 396-410 (lines=15) @@ | ||
| 393 | /** |
|
| 394 | * {@inheritdoc} |
|
| 395 | */ |
|
| 396 | public function addColumn(Table $table, Column $column) |
|
| 397 | { |
|
| 398 | $sql = sprintf( |
|
| 399 | 'ALTER TABLE %s ADD %s %s', |
|
| 400 | $this->quoteTableName($table->getName()), |
|
| 401 | $this->quoteColumnName($column->getName()), |
|
| 402 | $this->getColumnSqlDefinition($column) |
|
| 403 | ); |
|
| 404 | ||
| 405 | if ($column->getAfter()) { |
|
| 406 | $sql .= ' AFTER ' . $this->quoteColumnName($column->getAfter()); |
|
| 407 | } |
|
| 408 | ||
| 409 | $this->execute($sql); |
|
| 410 | } |
|
| 411 | ||
| 412 | /** |
|
| 413 | * {@inheritdoc} |
|
| @@ 450-463 (lines=14) @@ | ||
| 447 | /** |
|
| 448 | * {@inheritdoc} |
|
| 449 | */ |
|
| 450 | public function changeColumn($tableName, $columnName, Column $newColumn) |
|
| 451 | { |
|
| 452 | $after = $newColumn->getAfter() ? ' AFTER ' . $this->quoteColumnName($newColumn->getAfter()) : ''; |
|
| 453 | $this->execute( |
|
| 454 | sprintf( |
|
| 455 | 'ALTER TABLE %s CHANGE %s %s %s%s', |
|
| 456 | $this->quoteTableName($tableName), |
|
| 457 | $this->quoteColumnName($columnName), |
|
| 458 | $this->quoteColumnName($newColumn->getName()), |
|
| 459 | $this->getColumnSqlDefinition($newColumn), |
|
| 460 | $after |
|
| 461 | ) |
|
| 462 | ); |
|
| 463 | } |
|
| 464 | ||
| 465 | /** |
|
| 466 | * {@inheritdoc} |
|
| @@ 368-382 (lines=15) @@ | ||
| 365 | /** |
|
| 366 | * {@inheritdoc} |
|
| 367 | */ |
|
| 368 | public function addColumn(Table $table, Column $column) |
|
| 369 | { |
|
| 370 | $sql = sprintf( |
|
| 371 | 'ALTER TABLE %s ADD %s %s;', |
|
| 372 | $this->quoteTableName($table->getName()), |
|
| 373 | $this->quoteColumnName($column->getName()), |
|
| 374 | $this->getColumnSqlDefinition($column) |
|
| 375 | ); |
|
| 376 | ||
| 377 | if ($column->getComment()) { |
|
| 378 | $sql .= $this->getColumnCommentSqlDefinition($column, $table->getName()); |
|
| 379 | } |
|
| 380 | ||
| 381 | $this->execute($sql); |
|
| 382 | } |
|
| 383 | ||
| 384 | /** |
|
| 385 | * {@inheritdoc} |
|