<?php declare(strict_types=1);
namespace H1web\Blog;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Plugin\Context\InstallContext;
class H1webBlog extends Plugin
{
public function uninstall(UninstallContext $context): void
{
parent::uninstall($context);
if ($context->keepUserData()) {
return;
}
$connection = $this->container->get(Connection::class);
$connection->query('DROP TABLE IF EXISTS `h1webblog_blog_visibility`');
$connection->query('DROP TABLE IF EXISTS `h1webblog_blog_search_keyword`');
$connection->query('DROP TABLE IF EXISTS `h1webblog_blog_keyword_dictionary`');
$connection->query('DROP TABLE IF EXISTS `h1webblog_blog_translation`');
$connection->query('DROP TABLE IF EXISTS `h1webblog_option`');
$connection->query('DROP TABLE IF EXISTS `h1webblog_property`');
$connection->query('DROP TABLE IF EXISTS `h1webblog_tag`');
$connection->query('DROP TABLE IF EXISTS `h1webblog_category_tree`');
$connection->query('DROP TABLE IF EXISTS `h1webblog_category`');
$connection->query('DROP TABLE IF EXISTS `h1webblog_blog`');
$connection->query('DELETE FROM `seo_url_template` WHERE `route_name` LIKE "frontend.h1webblog.blog"');
$connection->query('DELETE FROM `media_default_folder` WHERE `entity` = "h1webblog_blog"');
$connection->query('DELETE FROM `media_folder` WHERE `name` = "Blog Media"');
}
}