Magento 2.4.2:以下模块已过时:Perfectmakeupmirrors_PmmHead 架构:当前版本 - none,所需版本 - 0.0.1

Magento 2.4.2: The following modules are outdated: Perfectmakeupmirrors_PmmHead schema: current version - none, required version - 0.0.1

我刚刚创建了一个自定义模块,通过使用事件和观察器在我们 Magento 站点的类别页面的头部添加元标记。重新加载类别页面时,下面是我看到的错误。我重新运行升级命令,但错误仍然存​​在。这是针对 noindex 和 nofollow 页面所做的。

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory.
The following modules are outdated:
Perfectmakeupmirrors_PmmHead schema: current version - none, required version - 0.0.1
Perfectmakeupmirrors_PmmHead data: current version - none, required version - 0.0.1

Exception #0 (Magento\Framework\Exception\LocalizedException): Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory.
The following modules are outdated:
Perfectmakeupmirrors_PmmHead schema: current version - none, required version - 0.0.1
Perfectmakeupmirrors_PmmHead data: current version - none, required version - 0.0.1
<pre>#1 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:71]
#2 Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#3 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/swissup/module-amp/Plugin/Framework/FrontController.php:48]
#4 Swissup\Amp\Plugin\Framework\FrontController->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#5 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#6 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]
#7 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]
#8 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#9 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:263]
#10 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:29]
</pre>

假设你有数据库的备份,尝试

DELETE FROM setup_module where module = "Perfectmakeupmirrors_PmmHead";

然后运行bin/magento setup:upgrade