@tsteur opened this issue on September 1st 2015

refs #8654

It looks like some updates might not be executed when being in development mode eg after switching branches. It might be because of this commit: https://github.com/piwik/piwik/commit/90372750b039ce0b2150d4d6b1279fecbb245465

Quite a while ago I worked on Piwik 3.0 and since then my Piwik stored current version is 3.0.0-b1. When switching back to 2.X branch (master) the updates from there won't be executed. This is not only a problem with 3.0 branch but in general. Maybe we should remove that check again? I understand that not showing/ignoring this error, that was disabled in this commit, can save time and that it is annoying but it also costs time and can lead to an "invalid" state of Piwik and random issues. I had to execute all updates from the past manually.

@mnapoli commented on September 2nd 2015

If you revert that commit it will just be back to the old behavior: Piwik will error when the DB is in a newer version. See the next lines of code: https://github.com/piwik/piwik/blob/90372750b039ce0b2150d4d6b1279fecbb245465/core/FrontController.php#L581 and this commit (along with the comments): c93d3e84a48cdfe5cf397b2fbd2e215014c5777d

There are no DB migration scripts to move from a more recent version to an older one, the problem isn't really related to "development mode" as it applies also in production.

@tsteur commented on September 2nd 2015

I think there is a problem if a branch with a higher version number doesn't contain the updates yet that are already in master or not? Removing that check would force me to change back the version number in option table.

@mattab commented on September 20th 2015

I think there is a problem if a branch with a higher version number doesn't contain the updates yet that are already in master or not?

yes there should be a problem in this case

Removing that check would force me to change back the version number in option table.

@tsteur Could we maybe detect when this case occurs and when it happens, display a tweaked error message eg We detected that your database has a newer schema version 2.ZZ than code and that you are in development mode. You may need to run the SQL query: 'UPDATE piwik_option set option_value=2.XX WHERE option_name = 'core_version' to ensure the updates to 2.ZZ are all executed.

@tsteur commented on September 21st 2015

We should be able to detect it in general as we only have to test for Development::isEnabled(). Showing the query should work as well. Maybe instead of showing the query we could also show a button "fix version" and a click on it would execute the displayed query and reload the page afterwards. Would safe even more time

Powered by GitHub Issue Mirror