Fatal errors when uninstalling CCC
## Problem/motivation Fatal errors when uninstalling CCC (1.0.x). ### First error 1. Install on CMS 2.1 2. Don't add anything 3. Uninstall 4. Error ``` In ExceptionHandler.php line 96: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.ai_context_usage' doesn't exist: SELECT "base_table"."id" AS "id", "base_table"."id" AS "base_table_id " FROM "ai_context_usage" "base_table" LIMIT 1 OFFSET 0; Array ( ) In PdoTrait.php line 109: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.ai_context_usage' doesn't exist ``` -- ### Second error 1. Install on CMS 2.1 2. Add context item 3. Test with debugger to get usage data 4. Uninstall ``` In EntityTypeManager.php line 139: The "ai_context_item" entity type does not exist. ``` 3. Go to: /admin/reports/dblog WSOD ``` The website encountered an unexpected error. Try again later. Drupal\Component\Plugin\Exception\PluginException: Plugin (ai_context_item_scheduler) instance class "Drupal\ai_context\Plugin\Scheduler\AiContextItemScheduler" does not exist. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 97 of core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php). Drupal\Core\Plugin\Factory\ContainerFactory->createInstance() (Line: 85) Drupal\Component\Plugin\PluginManagerBase->createInstance() (Line: 1492) Drupal\scheduler\SchedulerManager->doGetPlugins() (Line: 963) Drupal\scheduler\SchedulerManager->getPlugins() (Line: 1118) Drupal\scheduler\SchedulerManager->getUserPageViewRoutes() (Line: 18) Drupal\scheduler\Theme\SchedulerThemeNegotiator->applies() (Line: 67) Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme() (Line: 495) Drupal\Core\Theme\ThemeManager->initTheme() (Line: 99) Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 161) Drupal\canvas\Entity\PageRegion::loadForActiveTheme() (Line: 29) Drupal\canvas\EventSubscriber\PageVariantSelectorSubscriber->onSelectPageDisplayVariant() (Line: 246) Symfony\Component\EventDispatcher\EventDispatcher::{closure:Symfony\Component\EventDispatcher\EventDispatcher::optimizeListeners():241}() (Line: 206) Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (Line: 56) Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (Line: 224) Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 131) Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90) Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray() (Line: 246) Symfony\Component\EventDispatcher\EventDispatcher::{closure:Symfony\Component\EventDispatcher\EventDispatcher::optimizeListeners():241}() (Line: 206) Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (Line: 56) Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (Line: 188) Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53) Drupal\Core\StackMiddleware\Session->handle() (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28) Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32) Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 118) Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 92) Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 53) Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 54) Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 745) Drupal\Core\DrupalKernel->handle() (Line: 19) ```
issue