Initial commit: CloudOps infrastructure platform
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Mautic\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Mautic\CoreBundle\Doctrine\PreUpAssertionMigration;
|
||||
|
||||
final class Version20250402103942 extends PreUpAssertionMigration
|
||||
{
|
||||
protected const TABLE_NAME = 'form_fields';
|
||||
|
||||
protected function preUpAssertions(): void
|
||||
{
|
||||
$this->skipAssertion(
|
||||
fn (Schema $schema) => $schema->getTable($this->getPrefixedTableName(self::TABLE_NAME))->hasColumn('field_width'),
|
||||
'The field field_width already exists'
|
||||
);
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql("ALTER TABLE {$this->getPrefixedTableName(self::TABLE_NAME)} ADD field_width VARCHAR(50) DEFAULT '100%' NOT NULL");
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE {$this->getPrefixedTableName(self::TABLE_NAME)} DROP field_width');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user