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

refactor(robot-server): Adjust SQL declarations to match reality #16799

Merged
merged 7 commits into from
Nov 13, 2024

Conversation

SyntaxColoring
Copy link
Contributor

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.

@SyntaxColoring SyntaxColoring requested review from TamarZanzouri and a team November 13, 2024 20:45
@SyntaxColoring SyntaxColoring marked this pull request as ready for review November 13, 2024 20:45
@SyntaxColoring SyntaxColoring requested a review from a team as a code owner November 13, 2024 20:45
Comment on lines +213 to +216
# 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,
Copy link
Contributor Author

@SyntaxColoring SyntaxColoring Nov 13, 2024

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.

Copy link
Contributor

@TamarZanzouri TamarZanzouri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@SyntaxColoring SyntaxColoring merged commit 1b67a37 into edge Nov 13, 2024
37 checks passed
@SyntaxColoring SyntaxColoring deleted the sql_parity_fixing branch November 13, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants