@@ -149,9 +149,7 @@ def upgrade() -> None:
149149 # ``ON DELETE SET NULL`` keeps run history readable after a
150150 # KB is deleted (runs show "deleted KB" rather than
151151 # disappearing) while guaranteeing no dangling ``kb_id``.
152- sa .ForeignKeyConstraint (
153- ["kb_id" ], [f"{ KB_TABLE } .id" ], name = RUN_FK_NAME , ondelete = "SET NULL"
154- ),
152+ sa .ForeignKeyConstraint (["kb_id" ], [f"{ KB_TABLE } .id" ], name = RUN_FK_NAME , ondelete = "SET NULL" ),
155153 # Value allow-list mirrors ``IngestionRunStatus``. Prevents
156154 # typos ("Running" vs "running") from silently storing an
157155 # invalid state that list filters can't match.
@@ -172,9 +170,7 @@ def upgrade() -> None:
172170 # ------------------------------------------------------------------ #
173171 # job.job_metadata #
174172 # ------------------------------------------------------------------ #
175- if migration .table_exists (JOB_TABLE , conn ) and not migration .column_exists (
176- JOB_TABLE , JOB_METADATA_COLUMN , conn
177- ):
173+ if migration .table_exists (JOB_TABLE , conn ) and not migration .column_exists (JOB_TABLE , JOB_METADATA_COLUMN , conn ):
178174 # Per-domain progress / outcome data written from inside
179175 # ``execute_with_status``. Old code simply ignores it.
180176 op .add_column (JOB_TABLE , sa .Column (JOB_METADATA_COLUMN , JsonVariant , nullable = True ))
@@ -184,9 +180,7 @@ def downgrade() -> None:
184180 conn = op .get_bind ()
185181
186182 # job.job_metadata --------------------------------------------------- #
187- if migration .table_exists (JOB_TABLE , conn ) and migration .column_exists (
188- JOB_TABLE , JOB_METADATA_COLUMN , conn
189- ):
183+ if migration .table_exists (JOB_TABLE , conn ) and migration .column_exists (JOB_TABLE , JOB_METADATA_COLUMN , conn ):
190184 with op .batch_alter_table (JOB_TABLE , schema = None ) as batch_op :
191185 batch_op .drop_column (JOB_METADATA_COLUMN )
192186
0 commit comments