kin: KIN-ARCH-008 Конфигурируемая test_command на уровне проекта
This commit is contained in:
parent
538af5b799
commit
6eea439c16
3 changed files with 24 additions and 19 deletions
22
core/db.py
22
core/db.py
|
|
@ -612,16 +612,18 @@ def _migrate(conn: sqlite3.Connection):
|
|||
conn.commit()
|
||||
|
||||
# Migrate pipelines: add parent_pipeline_id and department columns (KIN-098)
|
||||
pipeline_cols = {r[1] for r in conn.execute("PRAGMA table_info(pipelines)").fetchall()}
|
||||
if "parent_pipeline_id" not in pipeline_cols:
|
||||
conn.execute("ALTER TABLE pipelines ADD COLUMN parent_pipeline_id INTEGER REFERENCES pipelines(id)")
|
||||
conn.commit()
|
||||
if "department" not in pipeline_cols:
|
||||
conn.execute("ALTER TABLE pipelines ADD COLUMN department TEXT")
|
||||
conn.commit()
|
||||
if "pid" not in pipeline_cols:
|
||||
conn.execute("ALTER TABLE pipelines ADD COLUMN pid INTEGER")
|
||||
conn.commit()
|
||||
# Guard: table may not exist in legacy schemas without pipelines (old test fixtures)
|
||||
if "pipelines" in existing_tables:
|
||||
pipeline_cols = {r[1] for r in conn.execute("PRAGMA table_info(pipelines)").fetchall()}
|
||||
if "parent_pipeline_id" not in pipeline_cols:
|
||||
conn.execute("ALTER TABLE pipelines ADD COLUMN parent_pipeline_id INTEGER REFERENCES pipelines(id)")
|
||||
conn.commit()
|
||||
if "department" not in pipeline_cols:
|
||||
conn.execute("ALTER TABLE pipelines ADD COLUMN department TEXT")
|
||||
conn.commit()
|
||||
if "pid" not in pipeline_cols:
|
||||
conn.execute("ALTER TABLE pipelines ADD COLUMN pid INTEGER")
|
||||
conn.commit()
|
||||
|
||||
# Create department_handoffs table (KIN-098)
|
||||
if "department_handoffs" not in existing_tables:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue