New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On updates, the version number is not updated when manually executing the SQL queries #7840
Comments
This is by design that the last SQL query updating the version is not displayed. Why? It was removed to prevent a bug. If you execute this SQL query then Piwik will believe it was already upgraded and will skip any non-sql updates. Sometimes we activate plugins during upgrades and we don't want to skip this, so even though you manually run the SQL queries you will still have to click in the UI or run |
Maybe this should be explained somewhere? Otherwise it ends up like in this case that users update the version manually |
I guess it matters only for users who used to see the last query and now don't see it. I guess it's a small number of users and not worth explaining this to all users (also I wouldn't know how to explain this clearly) |
How do we know a user inserted the SQL queries manually? Do we execute them all again? |
Yes we do run the SQL queries again, and if they were already executed they will be ignored due to the error code set with the SQL query. It's a bit fragile and it would be better to remember which SQL query was executed but so far it's how it's done. |
It is quite a bit fragile. Do we have tests for this? I doubt so. Since we sometimes also ADD values, eg an option etc this can even result in duplicate values etc. It is also likely that someone (a core developer or a plugin developer) forgets this use case (plugin developers can't know about that) and it results in errors that are hard to debug / explain etc. One more reason to refactor the updater in #5985 How can we improve that? |
refactor the updater in #5985 ? 😎 |
OK :) |
See #5985 and my comment: #7840 (comment) |
I prefer to manually execute the SQL queries that are needed when Piwik is updated. This gives me better control of what happens and when errors occur.
With the update to 2.13.0, I noticed that the version number is not updated, when I copy the SQL queries that Piwik shows on the page "a database update is needed". Because of this, even after I have executed all needed queries, Piwik still shows a message that the DB needs to be updated.
I had to manually execute "UPDATE piwik_option SET option_value = '2.13.0' WHERE option_name = 'version_core'" to fix this. This needs to be included in the SQL queries that Piwik presents for copy&paste.
The text was updated successfully, but these errors were encountered: