Update module to run alter command Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Update Admin module to add fields problemModule upgrade script is not being runUpdate customer attributes of old moduleHow to update database tables of already installed custom moduleAdd subscriber status to flat order gridUpdate custom module database - 7 shops same theme, plugins ect but fail at one shopSQL install script doesn't run in magento2UpgradeSchema for category attribute M2How to update datatype for column in custom module?Insert multiple records to multiple custom tables through install script in magento2

Writing a T-SQL stored procedure to receive 4 numbers and insert them into a table

Suing a Police Officer Instead of the Police Department

What is the ongoing value of the Kanban board to the developers as opposed to management

Processing ADC conversion result: DMA vs Processor Registers

/bin/ls sorts differently than just ls

How to translate "red flag" into Spanish?

SQL Server placement of master database files vs resource database files

Israeli soda type drink

What does こした mean?

`FindRoot [ ]`::jsing: Encountered a singular Jacobian at a point...WHY

How can I wire a 9-position switch so that each position turns on one more LED than the one before?

Determinant of a matrix with 2 equal rows

Putting Ant-Man on house arrest

Deciphering death certificate writing

Is it accepted to use working hours to read general interest books?

Does using the Inspiration rules for character defects encourage My Guy Syndrome?

false 'Security alert' from Google - every login generates mails from 'no-reply@accounts.google.com'

Why doesn't the university give past final exams' answers?

What was Apollo 13's "Little Jolt" after MECO?

Is there an efficient way for synchronising audio events real-time with LEDs using an MCU?

Preserving file and folder permissions with rsync

What's parked in Mil Moscow helicopter plant?

Is a self contained air-bullet cartridge feasible?

How to keep bees out of canned beverages?



Update module to run alter command



Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Update Admin module to add fields problemModule upgrade script is not being runUpdate customer attributes of old moduleHow to update database tables of already installed custom moduleAdd subscriber status to flat order gridUpdate custom module database - 7 shops same theme, plugins ect but fail at one shopSQL install script doesn't run in magento2UpgradeSchema for category attribute M2How to update datatype for column in custom module?Insert multiple records to multiple custom tables through install script in magento2



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I have created a module Vendor/Module I have added sql setup script in it. The module is working fine.



Now I need to alter table and add come more columns in the table. To do this I need to add new sql setup script and Update my module version.



Can anyone help me out on this? How can I do this?










share|improve this question




























    1















    I have created a module Vendor/Module I have added sql setup script in it. The module is working fine.



    Now I need to alter table and add come more columns in the table. To do this I need to add new sql setup script and Update my module version.



    Can anyone help me out on this? How can I do this?










    share|improve this question
























      1












      1








      1








      I have created a module Vendor/Module I have added sql setup script in it. The module is working fine.



      Now I need to alter table and add come more columns in the table. To do this I need to add new sql setup script and Update my module version.



      Can anyone help me out on this? How can I do this?










      share|improve this question














      I have created a module Vendor/Module I have added sql setup script in it. The module is working fine.



      Now I need to alter table and add come more columns in the table. To do this I need to add new sql setup script and Update my module version.



      Can anyone help me out on this? How can I do this?







      magento2 module setup-script






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 19 at 5:26









      Muhammad AnasMuhammad Anas

      8031322




      8031322




















          3 Answers
          3






          active

          oldest

          votes


















          1














          First Update your moudule.xml



          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
          <module name="Your_Module" setup_version="1.0.1" schema_version="1.0.2">
          </module>
          </config>


          You can use UpgradeSchema.php

          Create UpgradeSchema.php in Setup/UpgradeSchema.php



          <?php

          namespace YourModuleSetup;

          use MagentoFrameworkSetupModuleContextInterface;
          use MagentoFrameworkSetupSchemaSetupInterface;
          use MagentoFrameworkSetupUpgradeSchemaInterface;

          class UpgradeSchema implements UpgradeSchemaInterface

          public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)

          $installer = $setup;

          $installer->startSetup();

          if(version_compare($context->getVersion(), '1.0.1', '<'))
          $table = $installer->getTable('your_table');
          //Your alteration logic
          $columns = [
          'your_column' =>
          [
          'type' => MagentoFrameworkDBDdlTable::TYPE_TEXT,
          'nullable' => false,
          'length' => 512,
          'default' => null,
          'comment' => 'You Column Comment',
          ],
          ];

          $connection = $installer->getConnection();

          foreach ($columns as $name => $definition)
          $connection->addColumn($table, $name, $definition);


          $installer->endSetup();







          share|improve this answer























          • Thanks. Your code is easier to understand. +1 for that

            – Muhammad Anas
            Apr 19 at 5:57


















          1














          Create file name called UpgradeSchema.php from your module Setup folders
          Ex: app/code/Vendor/Ecommerce/Setup/UpgradeSchema.php

          Here we are going to create column called vendor_isallowstatus

          Column name called : vendor_isallowstatus

          Table name : vendor_ecommerce

          adde below code into your file.



          Ex:



          if (version_compare($context->getVersion(), ‘2.0.5’) < 0) //My new upgrade file version is 2.0.5 incase if 2.0.6 then set 2.0.6



          Step:1



          <?php

          namespace VendorEcommerceSetup;
          use MagentoFrameworkSetupUpgradeSchemaInterface;
          use MagentoFrameworkSetupModuleContextInterface;
          use MagentoFrameworkSetupSchemaSetupInterface;
          class UpgradeSchema implements UpgradeSchemaInterface
          public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
          if (version_compare($context->getVersion(), '2.0.1') < 0)
          $setup->startSetup();
          $setup->getConnection()->addColumn(
          $setup->getTable('vendor_ecommerce'),
          'vendor_isallowstatus',
          ['type' => MagentoFrameworkDBDdlTable::TYPE_INT,
          'length' => '11',
          'nullable' => false,
          'default' => '0',
          'comment' => 'Vendor Is Allow Status']);
          $setup->endSetup();



          Step:2
          app/code/Vendor/Ecommerce/etc/module.xml



          <?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="Vendor_Ecommerce" setup_version="2.0.5">
          <sequence><module name="Vendor_Ecommerce"/></sequence>
          </module></config>


          Step:3
          After saving files, you need to run php bin/magento setup:upgrade. Now check your database and you will be able to find a new custom table and new column in 'vendor_ecommerce' table.






          share|improve this answer























          • You code is good enough to apply, but other answer is more understandable. +1 for your effort and help. Thanks mate :)

            – Muhammad Anas
            Apr 19 at 5:57


















          1














          If you're using Magento >= 2.3 it could be much better to use declarative schema for db : https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/db-schema.html






          share|improve this answer























          • Thanks for the answer. +1

            – Muhammad Anas
            Apr 19 at 9:08











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270732%2fupdate-module-to-run-alter-command%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          First Update your moudule.xml



          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
          <module name="Your_Module" setup_version="1.0.1" schema_version="1.0.2">
          </module>
          </config>


          You can use UpgradeSchema.php

          Create UpgradeSchema.php in Setup/UpgradeSchema.php



          <?php

          namespace YourModuleSetup;

          use MagentoFrameworkSetupModuleContextInterface;
          use MagentoFrameworkSetupSchemaSetupInterface;
          use MagentoFrameworkSetupUpgradeSchemaInterface;

          class UpgradeSchema implements UpgradeSchemaInterface

          public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)

          $installer = $setup;

          $installer->startSetup();

          if(version_compare($context->getVersion(), '1.0.1', '<'))
          $table = $installer->getTable('your_table');
          //Your alteration logic
          $columns = [
          'your_column' =>
          [
          'type' => MagentoFrameworkDBDdlTable::TYPE_TEXT,
          'nullable' => false,
          'length' => 512,
          'default' => null,
          'comment' => 'You Column Comment',
          ],
          ];

          $connection = $installer->getConnection();

          foreach ($columns as $name => $definition)
          $connection->addColumn($table, $name, $definition);


          $installer->endSetup();







          share|improve this answer























          • Thanks. Your code is easier to understand. +1 for that

            – Muhammad Anas
            Apr 19 at 5:57















          1














          First Update your moudule.xml



          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
          <module name="Your_Module" setup_version="1.0.1" schema_version="1.0.2">
          </module>
          </config>


          You can use UpgradeSchema.php

          Create UpgradeSchema.php in Setup/UpgradeSchema.php



          <?php

          namespace YourModuleSetup;

          use MagentoFrameworkSetupModuleContextInterface;
          use MagentoFrameworkSetupSchemaSetupInterface;
          use MagentoFrameworkSetupUpgradeSchemaInterface;

          class UpgradeSchema implements UpgradeSchemaInterface

          public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)

          $installer = $setup;

          $installer->startSetup();

          if(version_compare($context->getVersion(), '1.0.1', '<'))
          $table = $installer->getTable('your_table');
          //Your alteration logic
          $columns = [
          'your_column' =>
          [
          'type' => MagentoFrameworkDBDdlTable::TYPE_TEXT,
          'nullable' => false,
          'length' => 512,
          'default' => null,
          'comment' => 'You Column Comment',
          ],
          ];

          $connection = $installer->getConnection();

          foreach ($columns as $name => $definition)
          $connection->addColumn($table, $name, $definition);


          $installer->endSetup();







          share|improve this answer























          • Thanks. Your code is easier to understand. +1 for that

            – Muhammad Anas
            Apr 19 at 5:57













          1












          1








          1







          First Update your moudule.xml



          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
          <module name="Your_Module" setup_version="1.0.1" schema_version="1.0.2">
          </module>
          </config>


          You can use UpgradeSchema.php

          Create UpgradeSchema.php in Setup/UpgradeSchema.php



          <?php

          namespace YourModuleSetup;

          use MagentoFrameworkSetupModuleContextInterface;
          use MagentoFrameworkSetupSchemaSetupInterface;
          use MagentoFrameworkSetupUpgradeSchemaInterface;

          class UpgradeSchema implements UpgradeSchemaInterface

          public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)

          $installer = $setup;

          $installer->startSetup();

          if(version_compare($context->getVersion(), '1.0.1', '<'))
          $table = $installer->getTable('your_table');
          //Your alteration logic
          $columns = [
          'your_column' =>
          [
          'type' => MagentoFrameworkDBDdlTable::TYPE_TEXT,
          'nullable' => false,
          'length' => 512,
          'default' => null,
          'comment' => 'You Column Comment',
          ],
          ];

          $connection = $installer->getConnection();

          foreach ($columns as $name => $definition)
          $connection->addColumn($table, $name, $definition);


          $installer->endSetup();







          share|improve this answer













          First Update your moudule.xml



          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
          <module name="Your_Module" setup_version="1.0.1" schema_version="1.0.2">
          </module>
          </config>


          You can use UpgradeSchema.php

          Create UpgradeSchema.php in Setup/UpgradeSchema.php



          <?php

          namespace YourModuleSetup;

          use MagentoFrameworkSetupModuleContextInterface;
          use MagentoFrameworkSetupSchemaSetupInterface;
          use MagentoFrameworkSetupUpgradeSchemaInterface;

          class UpgradeSchema implements UpgradeSchemaInterface

          public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)

          $installer = $setup;

          $installer->startSetup();

          if(version_compare($context->getVersion(), '1.0.1', '<'))
          $table = $installer->getTable('your_table');
          //Your alteration logic
          $columns = [
          'your_column' =>
          [
          'type' => MagentoFrameworkDBDdlTable::TYPE_TEXT,
          'nullable' => false,
          'length' => 512,
          'default' => null,
          'comment' => 'You Column Comment',
          ],
          ];

          $connection = $installer->getConnection();

          foreach ($columns as $name => $definition)
          $connection->addColumn($table, $name, $definition);


          $installer->endSetup();








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 19 at 5:47









          RizwanRizwan

          967526




          967526












          • Thanks. Your code is easier to understand. +1 for that

            – Muhammad Anas
            Apr 19 at 5:57

















          • Thanks. Your code is easier to understand. +1 for that

            – Muhammad Anas
            Apr 19 at 5:57
















          Thanks. Your code is easier to understand. +1 for that

          – Muhammad Anas
          Apr 19 at 5:57





          Thanks. Your code is easier to understand. +1 for that

          – Muhammad Anas
          Apr 19 at 5:57













          1














          Create file name called UpgradeSchema.php from your module Setup folders
          Ex: app/code/Vendor/Ecommerce/Setup/UpgradeSchema.php

          Here we are going to create column called vendor_isallowstatus

          Column name called : vendor_isallowstatus

          Table name : vendor_ecommerce

          adde below code into your file.



          Ex:



          if (version_compare($context->getVersion(), ‘2.0.5’) < 0) //My new upgrade file version is 2.0.5 incase if 2.0.6 then set 2.0.6



          Step:1



          <?php

          namespace VendorEcommerceSetup;
          use MagentoFrameworkSetupUpgradeSchemaInterface;
          use MagentoFrameworkSetupModuleContextInterface;
          use MagentoFrameworkSetupSchemaSetupInterface;
          class UpgradeSchema implements UpgradeSchemaInterface
          public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
          if (version_compare($context->getVersion(), '2.0.1') < 0)
          $setup->startSetup();
          $setup->getConnection()->addColumn(
          $setup->getTable('vendor_ecommerce'),
          'vendor_isallowstatus',
          ['type' => MagentoFrameworkDBDdlTable::TYPE_INT,
          'length' => '11',
          'nullable' => false,
          'default' => '0',
          'comment' => 'Vendor Is Allow Status']);
          $setup->endSetup();



          Step:2
          app/code/Vendor/Ecommerce/etc/module.xml



          <?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="Vendor_Ecommerce" setup_version="2.0.5">
          <sequence><module name="Vendor_Ecommerce"/></sequence>
          </module></config>


          Step:3
          After saving files, you need to run php bin/magento setup:upgrade. Now check your database and you will be able to find a new custom table and new column in 'vendor_ecommerce' table.






          share|improve this answer























          • You code is good enough to apply, but other answer is more understandable. +1 for your effort and help. Thanks mate :)

            – Muhammad Anas
            Apr 19 at 5:57















          1














          Create file name called UpgradeSchema.php from your module Setup folders
          Ex: app/code/Vendor/Ecommerce/Setup/UpgradeSchema.php

          Here we are going to create column called vendor_isallowstatus

          Column name called : vendor_isallowstatus

          Table name : vendor_ecommerce

          adde below code into your file.



          Ex:



          if (version_compare($context->getVersion(), ‘2.0.5’) < 0) //My new upgrade file version is 2.0.5 incase if 2.0.6 then set 2.0.6



          Step:1



          <?php

          namespace VendorEcommerceSetup;
          use MagentoFrameworkSetupUpgradeSchemaInterface;
          use MagentoFrameworkSetupModuleContextInterface;
          use MagentoFrameworkSetupSchemaSetupInterface;
          class UpgradeSchema implements UpgradeSchemaInterface
          public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
          if (version_compare($context->getVersion(), '2.0.1') < 0)
          $setup->startSetup();
          $setup->getConnection()->addColumn(
          $setup->getTable('vendor_ecommerce'),
          'vendor_isallowstatus',
          ['type' => MagentoFrameworkDBDdlTable::TYPE_INT,
          'length' => '11',
          'nullable' => false,
          'default' => '0',
          'comment' => 'Vendor Is Allow Status']);
          $setup->endSetup();



          Step:2
          app/code/Vendor/Ecommerce/etc/module.xml



          <?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="Vendor_Ecommerce" setup_version="2.0.5">
          <sequence><module name="Vendor_Ecommerce"/></sequence>
          </module></config>


          Step:3
          After saving files, you need to run php bin/magento setup:upgrade. Now check your database and you will be able to find a new custom table and new column in 'vendor_ecommerce' table.






          share|improve this answer























          • You code is good enough to apply, but other answer is more understandable. +1 for your effort and help. Thanks mate :)

            – Muhammad Anas
            Apr 19 at 5:57













          1












          1








          1







          Create file name called UpgradeSchema.php from your module Setup folders
          Ex: app/code/Vendor/Ecommerce/Setup/UpgradeSchema.php

          Here we are going to create column called vendor_isallowstatus

          Column name called : vendor_isallowstatus

          Table name : vendor_ecommerce

          adde below code into your file.



          Ex:



          if (version_compare($context->getVersion(), ‘2.0.5’) < 0) //My new upgrade file version is 2.0.5 incase if 2.0.6 then set 2.0.6



          Step:1



          <?php

          namespace VendorEcommerceSetup;
          use MagentoFrameworkSetupUpgradeSchemaInterface;
          use MagentoFrameworkSetupModuleContextInterface;
          use MagentoFrameworkSetupSchemaSetupInterface;
          class UpgradeSchema implements UpgradeSchemaInterface
          public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
          if (version_compare($context->getVersion(), '2.0.1') < 0)
          $setup->startSetup();
          $setup->getConnection()->addColumn(
          $setup->getTable('vendor_ecommerce'),
          'vendor_isallowstatus',
          ['type' => MagentoFrameworkDBDdlTable::TYPE_INT,
          'length' => '11',
          'nullable' => false,
          'default' => '0',
          'comment' => 'Vendor Is Allow Status']);
          $setup->endSetup();



          Step:2
          app/code/Vendor/Ecommerce/etc/module.xml



          <?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="Vendor_Ecommerce" setup_version="2.0.5">
          <sequence><module name="Vendor_Ecommerce"/></sequence>
          </module></config>


          Step:3
          After saving files, you need to run php bin/magento setup:upgrade. Now check your database and you will be able to find a new custom table and new column in 'vendor_ecommerce' table.






          share|improve this answer













          Create file name called UpgradeSchema.php from your module Setup folders
          Ex: app/code/Vendor/Ecommerce/Setup/UpgradeSchema.php

          Here we are going to create column called vendor_isallowstatus

          Column name called : vendor_isallowstatus

          Table name : vendor_ecommerce

          adde below code into your file.



          Ex:



          if (version_compare($context->getVersion(), ‘2.0.5’) < 0) //My new upgrade file version is 2.0.5 incase if 2.0.6 then set 2.0.6



          Step:1



          <?php

          namespace VendorEcommerceSetup;
          use MagentoFrameworkSetupUpgradeSchemaInterface;
          use MagentoFrameworkSetupModuleContextInterface;
          use MagentoFrameworkSetupSchemaSetupInterface;
          class UpgradeSchema implements UpgradeSchemaInterface
          public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
          if (version_compare($context->getVersion(), '2.0.1') < 0)
          $setup->startSetup();
          $setup->getConnection()->addColumn(
          $setup->getTable('vendor_ecommerce'),
          'vendor_isallowstatus',
          ['type' => MagentoFrameworkDBDdlTable::TYPE_INT,
          'length' => '11',
          'nullable' => false,
          'default' => '0',
          'comment' => 'Vendor Is Allow Status']);
          $setup->endSetup();



          Step:2
          app/code/Vendor/Ecommerce/etc/module.xml



          <?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="Vendor_Ecommerce" setup_version="2.0.5">
          <sequence><module name="Vendor_Ecommerce"/></sequence>
          </module></config>


          Step:3
          After saving files, you need to run php bin/magento setup:upgrade. Now check your database and you will be able to find a new custom table and new column in 'vendor_ecommerce' table.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 19 at 5:48









          Rakesh DongaRakesh Donga

          2,681317




          2,681317












          • You code is good enough to apply, but other answer is more understandable. +1 for your effort and help. Thanks mate :)

            – Muhammad Anas
            Apr 19 at 5:57

















          • You code is good enough to apply, but other answer is more understandable. +1 for your effort and help. Thanks mate :)

            – Muhammad Anas
            Apr 19 at 5:57
















          You code is good enough to apply, but other answer is more understandable. +1 for your effort and help. Thanks mate :)

          – Muhammad Anas
          Apr 19 at 5:57





          You code is good enough to apply, but other answer is more understandable. +1 for your effort and help. Thanks mate :)

          – Muhammad Anas
          Apr 19 at 5:57











          1














          If you're using Magento >= 2.3 it could be much better to use declarative schema for db : https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/db-schema.html






          share|improve this answer























          • Thanks for the answer. +1

            – Muhammad Anas
            Apr 19 at 9:08















          1














          If you're using Magento >= 2.3 it could be much better to use declarative schema for db : https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/db-schema.html






          share|improve this answer























          • Thanks for the answer. +1

            – Muhammad Anas
            Apr 19 at 9:08













          1












          1








          1







          If you're using Magento >= 2.3 it could be much better to use declarative schema for db : https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/db-schema.html






          share|improve this answer













          If you're using Magento >= 2.3 it could be much better to use declarative schema for db : https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/db-schema.html







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 19 at 7:02









          dharthdharth

          284




          284












          • Thanks for the answer. +1

            – Muhammad Anas
            Apr 19 at 9:08

















          • Thanks for the answer. +1

            – Muhammad Anas
            Apr 19 at 9:08
















          Thanks for the answer. +1

          – Muhammad Anas
          Apr 19 at 9:08





          Thanks for the answer. +1

          – Muhammad Anas
          Apr 19 at 9:08

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270732%2fupdate-module-to-run-alter-command%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Bulk add to cart function issuecart vs. mini cart issue … rwd themeRedirect Add to cart button to cart pageAdd to cart issue - Magento 2.1The requested Payment Method is not available When creating an orderM2: reason add-to-cart might not function in production modeAdd to cart issue in some android devicesMagento 2 - custom price can not add to subtotal and grand total after add to cartAdd to cart codeIssue with my cart module on pdp and cart pages, just keeps spinningBulk price and quantity update using rest api

          БиармияSxpst500bh2ntaf! 3h2r