Add explicit Huawei hop system-view option and startup column safety-net.

Some hops only accept stelnet in system-view; make it a saved yes/no setting (default off) instead of auto-retry, and always ALTER the new column on API boot when Alembic skips legacy DDL.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-08-28 23:58:05 +08:00
parent 0a550abcb0
commit b36174bfa4
20 changed files with 242 additions and 10 deletions

View file

@ -11,6 +11,7 @@ from .schema_patches import (
apply_all_legacy_startup_ddl,
apply_auth_schema_patches,
apply_collection_schema_safety_net,
apply_hop_schema_safety_net,
apply_topology_schema_safety_net,
run_alembic_upgrade_to_head,
)
@ -56,12 +57,13 @@ def run_api_startup() -> None:
try:
with engine.begin() as conn:
apply_auth_schema_patches(conn)
# Critical topology columns even when full legacy DDL is skipped
# Critical columns even when full legacy DDL is skipped
# (e.g. alembic stamped head without applying domain patches).
apply_topology_schema_safety_net(conn)
apply_collection_schema_safety_net(conn)
apply_hop_schema_safety_net(conn)
except Exception:
_log.exception("startup: auth/topology/collection schema safety patches failed")
_log.exception("startup: auth/topology/collection/hop schema safety patches failed")
if skip_ddl and alembic_ok:
_log.info("startup: schema via Alembic (legacy inline DDL skipped)")
else: