Vinai / groupscatalog2

Magento extension to enable you to hide categories and products from customers depending on their customer group. This is a Magento 1.6 and newer compatible version of the Netzarbeiter Customer Groups Catalog extension.
139 stars 60 forks source link

Upgrading to 0.2.7 from 0.1.0 fails, missing columns in groupscatalog_category_idx #49

Closed bdgeorge closed 11 years ago

bdgeorge commented 11 years ago

The upgrade SQL file is called upgrade-0.2.4-0.2.5.php so if you get version 0.2.7 from GitHub and you were on an earlier release like 0.1 then the upgrade SQL doesn't run.

So the fix is rename the file to upgrade-0.2.4-0.2.7.php and re-run the installation.

If this error has already hit you then you can fix it in your installation by renaming the script then in your database drop the core_resource version back to your earlier release and hit the site again, this will retrigger the installer.

Vinai commented 11 years ago

Thanks for your report, but it's actually not required that the upgrade scripts match the final module version. If your fix works, it's because the script didn't run the first time, maybe because of the cache. You can actually look up the corresponding code in Mage_Core_Model_Resource_Setup::_getModifySqlFiles() in the upgrade branch of the switch. It only checks for lower or equals the current module version.

bdgeorge commented 11 years ago

Interesting, I'm not sure why it didn't run then, it's on a dev server with caching turned off - the installer itself did run as the core_resource entry bumped up to 0.27 just the schema didn't change… Lets put it down to some random other hiccup in my stack then!

Vinai commented 11 years ago

Never the less, thank you for your report. This seems to happen on random occasions. I think I'll create a new install script for new installations, that might be a more reliable solution.

Vinai commented 11 years ago

Done in 3388eeb78aa7d9b87a4458d2ce6b95984dcaf1dd