30 lines
850 B
PHP
Executable File
30 lines
850 B
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Mautic\Migrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\Exception\SkipMigration;
|
|
use Mautic\CoreBundle\Doctrine\AbstractMauticMigration;
|
|
|
|
final class Version20210115065034 extends AbstractMauticMigration
|
|
{
|
|
public function preUp(Schema $schema): void
|
|
{
|
|
if ($schema->getTable($this->prefix.'emails')->hasColumn('preheader_text')) {
|
|
throw new SkipMigration('The emails table already includes the preheader_text column');
|
|
}
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$this->addSql("ALTER TABLE {$this->prefix}emails ADD `preheader_text` VARCHAR(130) NULL AFTER `subject`");
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql("ALTER TABLE {$this->prefix}emails DROP COLUMN `preheader_text`");
|
|
}
|
|
}
|