File size: 898 Bytes
d2897cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php

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
    }
}