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
Automatically delete duplicate keys in oc_appconfig table #8469
Comments
Looking at the code it seems that latest row (in whatever order the sql server feels like) will be used while reading the values. Do you know a clean (preferably pure SQL) way to remove the tables that are ignored while reading? |
I would rather not rely on that actually being the case. I am pretty sure this won't hold for all DBMSes. If there is no consent it is basically a) Pick a random value or b) ask the user. |
Ask the user is not an option because there is no way the user can do the right decision. |
There is no need to ask the user. The code that reads the appconfig values from the database already implicitly chooses one of the values which is the same one as the over who we should keep during migration. That way the configuration stays the same and from the users perspective nothing had changed. |
There is no guarantee that this selection is deterministic. Different queries may return different results. Internal database reorganisation may change returned values for the same query. So this strategy is basically the same as "pick a random value" but possibly with a higher chance of returning the correct value. I am fine with doing it like that. |
Here is some pseudocode that might be helpful. I probably wouldn't invest more time to be more clever when deleting rows.
|
From what I saw while testing #7015, it seems that we already have an index on oc_appconfig in OC 6. Both OC 6 and OC 7 have an index in oc_appconfig, but not OC 5. |
O.K. Closing for now. |
In some migration cases, the oc_appconfig table contains duplicate keys.
These need to be deleted/resolved on upgrade.
@icewind1991
The text was updated successfully, but these errors were encountered: