rollbackMigration example

use KernelTestBehaviour;

    private Connection $connection;

    private Migration1678969082DropVariantListingFields $migration;

    protected function setUp(): void
    {
        $this->connection = KernelLifecycleManager::getConnection();
        $this->migration = new Migration1678969082DropVariantListingFields();

        $this->rollbackMigration();
    }

    public function testMigration(): void
    {
        $this->migration->updateDestructive($this->connection);
        $this->migration->updateDestructive($this->connection);

        static::assertFalse(EntityDefinitionQueryHelper::columnExists($this->connection, 'product', 'configurator_group_config'));
        static::assertFalse(EntityDefinitionQueryHelper::columnExists($this->connection, 'product', 'display_parent'));
        static::assertFalse(EntityDefinitionQueryHelper::columnExists($this->connection, 'product', 'main_variant_id'));
    }

    
use KernelTestBehaviour;

    private Connection $connection;

    private Migration1678197291ConvertVariantListingConfig $migration;

    protected function setUp(): void
    {
        $this->connection = KernelLifecycleManager::getConnection();
        $this->migration = new Migration1678197291ConvertVariantListingConfig();

        $this->rollbackMigration();
    }

    protected function tearDown(): void
    {
        $this->connection->executeStatement('DELETE FROM `product`');
    }

    public function testMigration(): void
    {
        $this->migration->update($this->connection);
        $this->migration->update($this->connection);

        
Home | Imprint | This part of the site doesn't use cookies.