@@ 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} |
@@ 406-420 (lines=15) @@ | ||
403 | /** |
|
404 | * {@inheritdoc} |
|
405 | */ |
|
406 | public function addColumn(Table $table, Column $column) |
|
407 | { |
|
408 | $sql = sprintf( |
|
409 | 'ALTER TABLE %s ADD %s %s;', |
|
410 | $this->quoteTableName($table->getName()), |
|
411 | $this->quoteColumnName($column->getName()), |
|
412 | $this->getColumnSqlDefinition($column) |
|
413 | ); |
|
414 | ||
415 | if ($column->getComment()) { |
|
416 | $sql .= $this->getColumnCommentSqlDefinition($column, $table->getName()); |
|
417 | } |
|
418 | ||
419 | $this->execute($sql); |
|
420 | } |
|
421 | ||
422 | /** |
|
423 | * {@inheritdoc} |