Skip to content
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

Closed
larsen0815 opened this issue May 5, 2015 · 10 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.

Comments

@larsen0815
Copy link

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.

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label May 5, 2015
@tsteur tsteur added this to the Piwik 2.14.0 milestone May 5, 2015
@tsteur
Copy link
Member

tsteur commented May 5, 2015

Thx for the report! I can reproduce this. I would have expected to see this query in the UI but it was not listed. I'm pretty sure it used to be case.

update_no_version

@mattab
Copy link
Member

mattab commented May 6, 2015

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 ./console core:update to finish the upgrade.

@tsteur
Copy link
Member

tsteur commented May 6, 2015

Maybe this should be explained somewhere? Otherwise it ends up like in this case that users update the version manually

@mattab
Copy link
Member

mattab commented May 6, 2015

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)

@tsteur
Copy link
Member

tsteur commented May 6, 2015

How do we know a user inserted the SQL queries manually? Do we execute them all again?

@mattab
Copy link
Member

mattab commented May 6, 2015

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.

@tsteur
Copy link
Member

tsteur commented May 6, 2015

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?

@mattab
Copy link
Member

mattab commented May 14, 2015

How can we improve that?

refactor the updater in #5985 ? 😎

@tsteur
Copy link
Member

tsteur commented May 14, 2015

OK :)

@diosmosis diosmosis self-assigned this May 18, 2015
@diosmosis diosmosis modified the milestones: 3.0.0, 2.14.0 May 19, 2015
@diosmosis diosmosis removed their assignment May 22, 2015
@mattab
Copy link
Member

mattab commented Jun 18, 2015

See #5985 and my comment: #7840 (comment)

@mattab mattab closed this as completed Jun 18, 2015
@mattab mattab added duplicate For issues that already existed in our issue tracker and were reported previously. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it. labels Jun 18, 2015
@mattab mattab modified the milestones: Short term, 3.0.0 Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

4 participants