Spaces:
No application file
No application file
declare(strict_types=1); | |
namespace <namespace>; | |
use Doctrine\DBAL\Schema\Schema; | |
use Mautic\CoreBundle\Doctrine\PreUpAssertionMigration; | |
final class <className> extends PreUpAssertionMigration | |
{ | |
protected function preUpAssertions(): void | |
{ | |
// Please add an assertion for every SQL you define in the `up()` method. | |
// The order does matter! | |
// E.g.: | |
/* | |
$this->skipAssertion( | |
fn (Schema $schema) => $schema->hasTable("{$this->prefix}table_name"), | |
"Table {$this->prefix}table_name already exists" | |
); | |
$this->skipAssertion( | |
fn (Schema $schema) => $schema->getTable("{$this->prefix}table_name")->hasIndex('index_name'), | |
'Index index_name already exists' | |
); | |
*/ | |
} | |
public function up(Schema $schema): void | |
{ | |
// Please modify to your needs | |
} | |
} | |