<?php declare(strict_types=1);
/**
* @support Crehler <support@crehler.com>
* @copyright Crehler Sp. z o. o.
* @version: 1.0
*/
namespace Crehler\AdditionalArticle;
use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\{
ActivateContext,
UninstallContext
};
/**
* Class AdditionalArticle
* @package Crehler\AdditionalArticle
*/
class CrehlerAdditionalArticle extends Plugin
{
/**
* @param ActivateContext $activateContext
* @throws \Exception
*/
public function activate(ActivateContext $activateContext): void
{
}
/**
* @param UninstallContext $context
*/
public function uninstall(UninstallContext $context): void
{
parent::uninstall($context);
if ($context->keepUserData()) {
return;
}
$connection = $this->container->get(Connection::class);
$connection->executeUpdate('DROP TABLE IF EXISTS `additional_products`');
$connection->executeUpdate('ALTER TABLE `product` DROP COLUMN `additional_set_product_stream_id`');
}
}