Initial commit: CloudOps infrastructure platform
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?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`");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user