-
Notifications
You must be signed in to change notification settings - Fork 80
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
ENHish: fixes #849 - NOT READY TO MERGE #860
Conversation
There are legitimate failures in the build. |
conn = SQLConnectionHandler() | ||
|
||
current_patch = conn.execute_fetchone( | ||
# Test to see if the settings table up to date. The settings table is not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
table
-> table is
I think this is the correct path to follow and avoid the inline patch that you currently have in your PR. |
Code looks good otherwise! |
👍 ... sorry for the triple email. |
Agree with @ElDeveloper, patch is better than "fixing" on code |
My only question is if such table can go into the qiita schema... I remember that there was some good reasons to keep it outside, but I don't remember right now. @adamrp @squirrelo do you remember? |
We left it outside so that the database could constantly have a marker of if it was a test database or not, independent of the actual schema. This way if the schema dropped it would still be marked as a test database or not. |
@squirrelo exactly; also, IIRC running tests drops the qiita schema between On Thu, Feb 26, 2015 at 10:34 PM, Joshua Shorenstein <
|
It sucks so much having this separate but as long as we basically never need to modify this table, then we're fine. If we need to do additional modifications, then I think we may want to revisit whether we need to have the settings table separate, and if so, what other strategies might be apprioriate |
Since we are tracking non-static things that change as the schema is dropped, can we have a generic settings table and a |
Is this still relevant or can it be closed? |
This is taking care by #1318 since the python patch is executed in the same transaction as the SQL path so if it fails the SQL path is also rollbacked. |
Can this be closed due to #1318 being merged? |
Correct, this is no longer needed |
Python patches are tracked separately, and an N-1 python patch can be applied. What this means practically is that, if a python patch fails, patching execution stops. When a patch is attempted again, the patch system will check if there is a python patch that was not applied (that corresponds to the present SQL patch level), and apply it.
This is not ideal however. This requires a patch to the
settings
table. Thesettings
table is not part of theqiita
schema though. As a result, this table is not dropped onclean_test
. What this means is that patches to thesettings
table cannot be done through the patch system, and either require a different mechanism or hard coded patches. This PR is doing the latter as the former is very not fun, and it is not clear if there is a benefit from the effort required to appropriately resolve the logic in the face of a production system. The other option I see is to move thesettings
table into theqiita
schema and allow it to be dropped. Open to other suggestions here though.