7

In my Module have a table script inside the InstallSchema class. When I ran the below commands, it's not installing.

Commands

php bin/magento cache:clean
php bin/magento setup:upgrade
php bin/magento setup:db-schema:upgrade

But I have created the same code as another new module, and I have executed the above commands it's installed.

Is there any table to clear the module version in Magento 1 like (core_resource)?

4 Answers 4

20

In Magento 2 version information is stored on setup_module table. So you can remove your module and re run the commands it will work.

2
  • Timely help. +1, is it the standard procedure to install the script? Or a shortcut in case of not installing after upgrade?
    – Anto S
    Dec 13, 2018 at 13:46
  • @Butterfly if you specify versions magento will install automatically when run the upgrade command other wise need to remove module from setup_module table and run the upgrade command. Dec 14, 2018 at 6:25
2

Some time there may an entry for you module in

 app/etc/config.php 

with value 0. And if you run the command

 bin/magento setup:upgrade

then it will not upgrade your plugin. Change the vaue to 1 and run the command again.

1
  • 1
    This helped me :) Thanks for the input
    – Mohammed
    Jun 16, 2022 at 10:18
0

Please check entry in setup_module table.and also check InstallSchema class name and namespace according to your module.delete entry from setup_module and run command php bin/magento setup:upgrade

0

If your module is created successful but not stored in setup_module table, check out you not missing the setup_version in your xml file:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Mageplaza_HelloWorld" setup_version="1.0.0"/>
</config>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.