$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'
));
} private function rollbackMigration(): void
{ if (EntityDefinitionQueryHelper::
columnExists($this->connection, 'product', 'variant_listing_config'
)) { $this->connection->
executeStatement('ALTER TABLE `product` DROP COLUMN `variant_listing_config`, ADD COLUMN `variant_listing_config` JSON NULL DEFAULT NULL'
);
} if (!EntityDefinitionQueryHelper::
columnExists($this->connection, 'product', 'display_parent'
)) {