Skip to content

Commit

Permalink
Deduplicate index declaration and avoid executing raw string.
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed Nov 21, 2024
1 parent afbe61e commit f6b61b7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions robot-server/robot_server/persistence/_migrations/v7_to_v8.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ def migrate(self, source_dir: Path, dest_dir: Path) -> None:
def _add_missing_indexes(dest_transaction: sqlalchemy.engine.Connection) -> None:
# todo(2024-11-20): Probably add the indexes missing from prior migrations here.
# https://opentrons.atlassian.net/browse/EXEC-827
dest_transaction.execute(
"CREATE UNIQUE INDEX ix_run_run_id_command_status_index_in_run ON run_command (run_id, command_status, index_in_run);"
index = next(
index
for index in schema_8.run_command_table.indexes
if index.name == "ix_run_run_id_command_status_index_in_run"
)
index.create(dest_transaction)


def _migrate_command_table_with_new_command_error_col_and_command_status(
Expand Down

0 comments on commit f6b61b7

Please sign in to comment.