Skip to content

Commit a84ac23

Browse files
committed
backend linting
1 parent d208fea commit a84ac23

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

backend/app/utils/migrations.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# app/utils/migrations.py
21
import hashlib
32

43
from app.schemas.classification_schemas import Classification
@@ -224,7 +223,6 @@ def create_migrations(
224223

225224
for c in classifications:
226225
table_name = _table_name_for_classification(c)
227-
qualified_table_name = f"{schema_name}.{table_name}"
228226
mig_name = f"create_table_{schema_name}_{table_name}"
229227

230228
if mig_name in existing_names:
@@ -266,9 +264,6 @@ def create_migrations(
266264
):
267265
continue
268266

269-
qualified_from = f"{schema_name}.{from_table}"
270-
qualified_to = f"{schema_name}.{to_table}"
271-
272267
# Support both Enum and plain string for rel.type
273268
raw_type = getattr(rel.type, "value", rel.type)
274269
rel_type_norm = str(raw_type).upper().replace("-", "_")
@@ -290,7 +285,7 @@ def create_migrations(
290285
BEGIN
291286
ALTER TABLE "{schema_name}"."{from_table}"
292287
ADD COLUMN IF NOT EXISTS "{to_table}_id" UUID;
293-
288+
294289
IF NOT EXISTS (
295290
SELECT 1 FROM pg_constraint c
296291
JOIN pg_namespace n ON c.connamespace = n.oid
@@ -321,7 +316,7 @@ def create_migrations(
321316
BEGIN
322317
ALTER TABLE "{schema_name}"."{from_table}"
323318
ADD COLUMN IF NOT EXISTS "{to_table}_id" UUID;
324-
319+
325320
-- Add FK constraint if not exists
326321
IF NOT EXISTS (
327322
SELECT 1 FROM pg_constraint c
@@ -334,7 +329,7 @@ def create_migrations(
334329
FOREIGN KEY ("{to_table}_id")
335330
REFERENCES "{schema_name}"."{to_table}"(id);
336331
END IF;
337-
332+
338333
-- Add UNIQUE constraint if not exists
339334
IF NOT EXISTS (
340335
SELECT 1 FROM pg_constraint c

0 commit comments

Comments
 (0)