@@ 364-378 (lines=15) @@ | ||
361 | /** |
|
362 | * {@inheritdoc} |
|
363 | */ |
|
364 | public function addColumn(Table $table, Column $column) |
|
365 | { |
|
366 | $sql = sprintf( |
|
367 | 'ALTER TABLE %s ADD %s %s;', |
|
368 | $this->quoteTableName($table->getName()), |
|
369 | $this->quoteColumnName($column->getName()), |
|
370 | $this->getColumnSqlDefinition($column) |
|
371 | ); |
|
372 | ||
373 | if ($column->getComment()) { |
|
374 | $sql .= $this->getColumnCommentSqlDefinition($column, $table->getName()); |
|
375 | } |
|
376 | ||
377 | $this->execute($sql); |
|
378 | } |
|
379 | ||
380 | /** |
|
381 | * {@inheritdoc} |
@@ 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} |