for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Cycle\Migrations\Operation\Column;
use Cycle\Migrations\CapsuleInterface;
use Cycle\Migrations\Exception\Operation\ColumnException;
final class Alter extends Column
{
/**
* {@inheritdoc}
*/
public function execute(CapsuleInterface $capsule): void
$schema = $capsule->getSchema($this->getTable());
if (!$schema->hasColumn($this->name)) {
throw new ColumnException(
"Unable to alter column '{$schema->getName()}'.'{$this->name}', column does not exists"
);
}
//Declaring column change
$this->declareColumn($schema);