Magento 2 module “data_version - not upgrading"?





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







1















In Magento 2.0 I have written UpgradeData and UpgradeSchema and I have changed the setup_version in module.xml. After that I run php bin/magento setup:upgrade After this in the database, schema_version is upgrading but data_version not upgrading. Any Ideas?



UpgradeData.php



namespace VendorPawanSetup;
use MagentoFrameworkSetupUpgradeDataInterface;
use MagentoFrameworkSetupModuleContextInterface;
use MagentoFrameworkSetupModuleDataSetupInterface;

/**
* Upgrade data for SImple Google Shopping
*/
class UpgradeData implements UpgradeDataInterface
{

/**
* @param ModuleDataSetupInterface $setup
* @param ModuleContextInterface $context
*/
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{

// $context->getVersion() = version du module actuelle
// 10.0.0 = version en cours d'installation

if (version_compare($context->getVersion(), '10.0.0') < 0) {
$installer = $setup;
$installer->startSetup();
// do what you have to do

$installer->endSetup();
}
}
}


Module.xml



<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Vendor_Pawan" setup_version="2.1.1">

</module>
</config>









share|improve this question
















bumped to the homepage by Community 11 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • can you post your code?

    – Marius
    Mar 10 '16 at 9:46











  • Module.xml :::: <config xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> <module name="Vendor_Pawan" setup_version="2.1.1"> </module> </config>

    – Pawankumar
    Mar 10 '16 at 9:48













  • the above is my code

    – Pawankumar
    Mar 10 '16 at 9:51


















1















In Magento 2.0 I have written UpgradeData and UpgradeSchema and I have changed the setup_version in module.xml. After that I run php bin/magento setup:upgrade After this in the database, schema_version is upgrading but data_version not upgrading. Any Ideas?



UpgradeData.php



namespace VendorPawanSetup;
use MagentoFrameworkSetupUpgradeDataInterface;
use MagentoFrameworkSetupModuleContextInterface;
use MagentoFrameworkSetupModuleDataSetupInterface;

/**
* Upgrade data for SImple Google Shopping
*/
class UpgradeData implements UpgradeDataInterface
{

/**
* @param ModuleDataSetupInterface $setup
* @param ModuleContextInterface $context
*/
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{

// $context->getVersion() = version du module actuelle
// 10.0.0 = version en cours d'installation

if (version_compare($context->getVersion(), '10.0.0') < 0) {
$installer = $setup;
$installer->startSetup();
// do what you have to do

$installer->endSetup();
}
}
}


Module.xml



<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Vendor_Pawan" setup_version="2.1.1">

</module>
</config>









share|improve this question
















bumped to the homepage by Community 11 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • can you post your code?

    – Marius
    Mar 10 '16 at 9:46











  • Module.xml :::: <config xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> <module name="Vendor_Pawan" setup_version="2.1.1"> </module> </config>

    – Pawankumar
    Mar 10 '16 at 9:48













  • the above is my code

    – Pawankumar
    Mar 10 '16 at 9:51














1












1








1








In Magento 2.0 I have written UpgradeData and UpgradeSchema and I have changed the setup_version in module.xml. After that I run php bin/magento setup:upgrade After this in the database, schema_version is upgrading but data_version not upgrading. Any Ideas?



UpgradeData.php



namespace VendorPawanSetup;
use MagentoFrameworkSetupUpgradeDataInterface;
use MagentoFrameworkSetupModuleContextInterface;
use MagentoFrameworkSetupModuleDataSetupInterface;

/**
* Upgrade data for SImple Google Shopping
*/
class UpgradeData implements UpgradeDataInterface
{

/**
* @param ModuleDataSetupInterface $setup
* @param ModuleContextInterface $context
*/
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{

// $context->getVersion() = version du module actuelle
// 10.0.0 = version en cours d'installation

if (version_compare($context->getVersion(), '10.0.0') < 0) {
$installer = $setup;
$installer->startSetup();
// do what you have to do

$installer->endSetup();
}
}
}


Module.xml



<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Vendor_Pawan" setup_version="2.1.1">

</module>
</config>









share|improve this question
















In Magento 2.0 I have written UpgradeData and UpgradeSchema and I have changed the setup_version in module.xml. After that I run php bin/magento setup:upgrade After this in the database, schema_version is upgrading but data_version not upgrading. Any Ideas?



UpgradeData.php



namespace VendorPawanSetup;
use MagentoFrameworkSetupUpgradeDataInterface;
use MagentoFrameworkSetupModuleContextInterface;
use MagentoFrameworkSetupModuleDataSetupInterface;

/**
* Upgrade data for SImple Google Shopping
*/
class UpgradeData implements UpgradeDataInterface
{

/**
* @param ModuleDataSetupInterface $setup
* @param ModuleContextInterface $context
*/
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{

// $context->getVersion() = version du module actuelle
// 10.0.0 = version en cours d'installation

if (version_compare($context->getVersion(), '10.0.0') < 0) {
$installer = $setup;
$installer->startSetup();
// do what you have to do

$installer->endSetup();
}
}
}


Module.xml



<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Vendor_Pawan" setup_version="2.1.1">

</module>
</config>






magento2 setup-script






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 10 '16 at 21:02









Maddy

1,142713




1,142713










asked Mar 10 '16 at 9:42









PawankumarPawankumar

373318




373318





bumped to the homepage by Community 11 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 11 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • can you post your code?

    – Marius
    Mar 10 '16 at 9:46











  • Module.xml :::: <config xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> <module name="Vendor_Pawan" setup_version="2.1.1"> </module> </config>

    – Pawankumar
    Mar 10 '16 at 9:48













  • the above is my code

    – Pawankumar
    Mar 10 '16 at 9:51



















  • can you post your code?

    – Marius
    Mar 10 '16 at 9:46











  • Module.xml :::: <config xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> <module name="Vendor_Pawan" setup_version="2.1.1"> </module> </config>

    – Pawankumar
    Mar 10 '16 at 9:48













  • the above is my code

    – Pawankumar
    Mar 10 '16 at 9:51

















can you post your code?

– Marius
Mar 10 '16 at 9:46





can you post your code?

– Marius
Mar 10 '16 at 9:46













Module.xml :::: <config xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> <module name="Vendor_Pawan" setup_version="2.1.1"> </module> </config>

– Pawankumar
Mar 10 '16 at 9:48







Module.xml :::: <config xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> <module name="Vendor_Pawan" setup_version="2.1.1"> </module> </config>

– Pawankumar
Mar 10 '16 at 9:48















the above is my code

– Pawankumar
Mar 10 '16 at 9:51





the above is my code

– Pawankumar
Mar 10 '16 at 9:51










1 Answer
1






active

oldest

votes


















0














$setup->startSetup() and $setup->endSetup() should be outside if clause.



namespace VendorPawanSetup;
use MagentoFrameworkSetupUpgradeDataInterface;
use MagentoFrameworkSetupModuleContextInterface;
use MagentoFrameworkSetupModuleDataSetupInterface;

/**
* Upgrade data for SImple Google Shopping
*/
class UpgradeData implements UpgradeDataInterface
{

/**
* @param ModuleDataSetupInterface $setup
* @param ModuleContextInterface $context
*/
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{

$setup->startSetup();
// $context->getVersion() = version du module actuelle
// 10.0.0 = version en cours d'installation

if (version_compare($context->getVersion(), '10.0.0') < 0) {
// do what you have to do

}
$setup->endSetup();
}
}





share|improve this answer
























    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%2f105591%2fmagento-2-module-data-version-not-upgrading%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    $setup->startSetup() and $setup->endSetup() should be outside if clause.



    namespace VendorPawanSetup;
    use MagentoFrameworkSetupUpgradeDataInterface;
    use MagentoFrameworkSetupModuleContextInterface;
    use MagentoFrameworkSetupModuleDataSetupInterface;

    /**
    * Upgrade data for SImple Google Shopping
    */
    class UpgradeData implements UpgradeDataInterface
    {

    /**
    * @param ModuleDataSetupInterface $setup
    * @param ModuleContextInterface $context
    */
    public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {

    $setup->startSetup();
    // $context->getVersion() = version du module actuelle
    // 10.0.0 = version en cours d'installation

    if (version_compare($context->getVersion(), '10.0.0') < 0) {
    // do what you have to do

    }
    $setup->endSetup();
    }
    }





    share|improve this answer




























      0














      $setup->startSetup() and $setup->endSetup() should be outside if clause.



      namespace VendorPawanSetup;
      use MagentoFrameworkSetupUpgradeDataInterface;
      use MagentoFrameworkSetupModuleContextInterface;
      use MagentoFrameworkSetupModuleDataSetupInterface;

      /**
      * Upgrade data for SImple Google Shopping
      */
      class UpgradeData implements UpgradeDataInterface
      {

      /**
      * @param ModuleDataSetupInterface $setup
      * @param ModuleContextInterface $context
      */
      public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
      {

      $setup->startSetup();
      // $context->getVersion() = version du module actuelle
      // 10.0.0 = version en cours d'installation

      if (version_compare($context->getVersion(), '10.0.0') < 0) {
      // do what you have to do

      }
      $setup->endSetup();
      }
      }





      share|improve this answer


























        0












        0








        0







        $setup->startSetup() and $setup->endSetup() should be outside if clause.



        namespace VendorPawanSetup;
        use MagentoFrameworkSetupUpgradeDataInterface;
        use MagentoFrameworkSetupModuleContextInterface;
        use MagentoFrameworkSetupModuleDataSetupInterface;

        /**
        * Upgrade data for SImple Google Shopping
        */
        class UpgradeData implements UpgradeDataInterface
        {

        /**
        * @param ModuleDataSetupInterface $setup
        * @param ModuleContextInterface $context
        */
        public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
        {

        $setup->startSetup();
        // $context->getVersion() = version du module actuelle
        // 10.0.0 = version en cours d'installation

        if (version_compare($context->getVersion(), '10.0.0') < 0) {
        // do what you have to do

        }
        $setup->endSetup();
        }
        }





        share|improve this answer













        $setup->startSetup() and $setup->endSetup() should be outside if clause.



        namespace VendorPawanSetup;
        use MagentoFrameworkSetupUpgradeDataInterface;
        use MagentoFrameworkSetupModuleContextInterface;
        use MagentoFrameworkSetupModuleDataSetupInterface;

        /**
        * Upgrade data for SImple Google Shopping
        */
        class UpgradeData implements UpgradeDataInterface
        {

        /**
        * @param ModuleDataSetupInterface $setup
        * @param ModuleContextInterface $context
        */
        public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
        {

        $setup->startSetup();
        // $context->getVersion() = version du module actuelle
        // 10.0.0 = version en cours d'installation

        if (version_compare($context->getVersion(), '10.0.0') < 0) {
        // do what you have to do

        }
        $setup->endSetup();
        }
        }






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 10 '16 at 21:56







        user28171





































            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%2f105591%2fmagento-2-module-data-version-not-upgrading%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

            What other Star Trek series did the main TNG cast show up in?

            Berlina muro

            Berlina aerponto