<?php declare(strict_types=1);
namespace Ujy\Import;
use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\ActivateContext;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
class UjyImport extends Plugin
{
public function activate(ActivateContext $activateContext): void
{
}
public function uninstall(UninstallContext $uninstallContext): void
{
parent::uninstall($uninstallContext);
if ($uninstallContext->keepUserData()) {
return;
}
$connection = $this->container->get(Connection::class);
// Sangebot import
$connection->executeStatement('ALTER TABLE ujy_sangebot_to_category DROP index `unique.sangebot_id.name`');
$connection->executeStatement('ALTER TABLE ujy_sangebot_to_category DROP index `sangebot_id`');
$connection->executeStatement('DROP TABLE IF EXISTS `ujy_sangebot_to_category`');
// Remote product description
$connection->executeStatement('ALTER TABLE ujy_product_description DROP index `unique.vendor_code`');
$connection->executeStatement('DROP TABLE IF EXISTS `ujy_product_description`');
}
}