I have created an installschema for my custom table to be created.

namespace Vendor\Module\Setup;

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

class InstallSchema implements InstallSchemaInterface

    public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
    $installer = $setup;
     * Create new table 'my_table1'
    $table = $installer->getConnection()
            ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true],
            ['unsigned' => true, 'nullable' => false, 'default' => '0'],
            'Product ID'
        ->setComment('My new table');

And I gave setup:upgrade, but Im not able to see my custom table in the database. Where is my code wrong?

  • got any error while run command? Jul 20, 2016 at 7:14
  • no... php bin/magento setup:upgrade ran completely, my module is enabled
    – Sushivam
    Jul 20, 2016 at 7:15
  • I get 'My new table' as a comment in my debug.log...but no table in backend !!!
    – Sushivam
    Jul 20, 2016 at 7:16
  • Do you mean no table in database Jul 20, 2016 at 7:17
  • Yes no table in my DB
    – Sushivam
    Jul 20, 2016 at 7:18

1 Answer 1


Go to the database module_setup table

Check their is your setup with your setup_version and schema_vesrion

Delete that row and re run below command:

php bin/magento setup:upgrade
  • My module in bakend: Vendor_Module has schema and dataversion as 2.2.0.. u mean i have to delete that row and rerun?
    – Sushivam
    Jul 20, 2016 at 7:23
  • Yes you need to delete that row and rerun command Jul 20, 2016 at 7:24

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.