-
Notifications
You must be signed in to change notification settings - Fork 178
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
refactor(robot-server): Adjust SQL declarations to match reality #16799
Conversation
d99f786
to
438bfd2
Compare
# nullable=True to match the underlying SQL, which is nullable because of a bug | ||
# in the migration that introduced this column. This is not intended to ever be | ||
# null in practice. | ||
nullable=True, |
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.
Another way of explaining this, other than "migration bug," is that SQLite makes it very annoying to add non-nullable columns. Like, yeah, it's arguably a bug in the migration, but we'd have to go unusually far out of our way to avoid that bug, so is it really?
I'm happy to write whatever other people find more helpful.
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.
thanks!
Overview
This is step 2 towards fixing EXEC-827.
This retroactively edits our SQLAlchemy definitions to match what is actually running on robots. What is actually running on robots is decided by our migration system, and our migration system sometimes does manual
ALTER TABLE
fixups that do not exactly match our SQLAlchemy definitions. See EXEC-827 for details.So this PR shows some constraints and indexes that were accidentally omitted. The next step after this PR is to find a way to actually get them back. We're figuring that out over in #16697 (comment). It will probably piggyback on the new migration, v7->v8, that that PR is adding.
Test Plan and Hands on Testing
The correctness of these reconciliations is checked by a test added in #16772.
Review requests
None in particular.
Risk assessment
Low. This shouldn't cause any behavioral change.