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

SQL queries in upgrade files should always work when upgrade is executed several times #5809

Closed
mattab opened this issue Jul 10, 2014 · 0 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Jul 10, 2014

There are cases when an upgrade can fail, for example: when an upgrade adds a column to a table and an existing column with the same name already exists in that table. In this case there is possibility to ignore the error by setting in the getSql() a value eg. 1060, such as this example: 1.12-b16 upgrade

Goal of this ticket is to ensure that we force Piwik developers to always set a correct error code for each SQL query. This will ensure that when Piwik admins run the upgrade several times, then the upgrade will always succeed.

Proposal

  • maybe we throw an exception whenever a SQL query does not have an error code set? (eg. when => false in getSql). This exception will be seen by Piwik developer when he tests his upgrade file. Or if developer does not test his code (bad) then it should at least show in the Upgrade 1.0 -> latest version UI test (source)
  • we need to update existing upgrade files to make sure that all SQL queries have the proper error code set
@mattab mattab added this to the 2.5.0 - Piwik 2.5.0 milestone Jul 10, 2014
@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Sep 20, 2014
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. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

1 participant