I've created a custom module, and I see the row in the setup_module table. When I change my version and run magento setup:upgrade, the version number updates as well. However, the table I defined is not being created. I also see the new module enabled in app/etc/config.php

I tried installing a module written by Magento, but I still see the same behavior - row is in setup_module but table does not exist.

I tried deleting the row from setup_module table and rerun magento setup:upgrade to execute InstallSchema.php, but the database tables aren't created even though the row is created setup_module again.

I also tried incrementing the version number and try UpgradeSchema.php, but it doesn't execute even though row in setup_module is updated.

I introduced errors in both InstallSchema.php and UpgradeSchema.php, but magento setup:upgrade doesn't does not output the error messages.

I also tried recreating the installation, and ensuring the file permissions were correct (owned by magento:www-data). Any other ideas?

I'm using v2.0.7 CE provided by DigitalOcean.

namespace Test\Project\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Ddl\Table;

class InstallSchema implements InstallSchemaInterface
    public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
        $installer = $setup;

        // Get tables
        $tableName = $installer->getTable('test_module');

        // Create table
        $table = $installer->getConnection()
            'identity' => true,
            'unsigned' => true,
            'nullable' => false,
            'primary' => true
            ['nullable' => false, 'default' => ''],
        ->setOption('type', 'InnoDB')
        ->setOption('charset', 'utf8');

    } // close function install()
  • the module is enabled? try run bin/magento module:status. If not run bin/magento module:enable:<module_name>
    – 95623
    Sep 26, 2016 at 13:59
  • @95623 yes, the module is enabled. I see it in setup_module table as well as etc/config.php with value of 1
    – Chris
    Sep 27, 2016 at 20:44
  • try to delete all tables created by the module and downgrade/remove the module version on 'setup_module' table and re run setup:upgrade
    – 95623
    Sep 28, 2016 at 14:36
  • @95623 the module doesn't create any database tables in the first place...so there is nothing to delete. That's the main problem. Even if I put errors in InstallSchema.php and UpgradeSchema.php, and run setup:upgrade, it doesn't output any errors. It's as if those files aren't being read.
    – Chris
    Sep 29, 2016 at 22:25

5 Answers 5


I have tried the following thats works for me. please check.

delete from setup_module where  module ='module_name';
sudo bin/magento setup:upgrade
sudo bin/magento setup:di:compile
sudo bin/magento cache:clean

I resolved this by disabling all the caches via the admin and re-installing the module.


In my case the package name was wrong. After replacing by right package name issue is fixed.

namespace Package_Name\Module_Name\Setup;

Currently this way seems to be deprecated. Additionally to have entry in setup_module You have to have entered version in module.xml

 <module name="Vendor_module" setup_version="1.0.0">

Delete your module in setup_module then retry.

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.