-
Notifications
You must be signed in to change notification settings - Fork 77
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
Fix DB schema migrations #1797
Fix DB schema migrations #1797
Conversation
- Fix a wrong migration introduced in rust-lang#1781 - Clarify how DB migrations should be added to the triagebot
CREATE EXTENSION intarray; | ||
CREATE UNIQUE INDEX review_prefs_user_id ON review_prefs(user_id); | ||
CREATE EXTENSION IF NOT EXISTS intarray;", | ||
" | ||
CREATE UNIQUE INDEX IF NOT EXISTS review_prefs_user_id ON review_prefs(user_id); |
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.
I can't check the schema of the triagebot in prod but the clauses IF NOT EXISTS
should ensure nothing bad happens when applied.
I think we should get eyes on this from @Mark-Simulacrum as I'm not very familiar with how migrations work and what the current state of the db is. |
Will this fix the errors about |
@ehuss Yes and now I know why. Without this patch the migration would fail:
unsure why it didn't happen (or wasn't catched) during the triagebot deployment at the time 🤷♂️ (I probably missed that on my local workstation because I manually fiddled with the DB schema without proberly testing the migration process) EDIT: and that error we see in triagebot logs is triggered when from Zulip I request my PR work queue |
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.
After talking with @Kobzol seems like this is fine
r? @jackh726