fix(supervisor): use sqlmesh plan prod --auto-apply instead of run

'run' requires the prod environment to already exist and defaults to
dev_<username> on first run. 'plan --auto-apply' initializes prod if
missing and applies pending changes — fully self-healing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Deeman
2026-02-27 15:49:38 +01:00
parent dd07b0218b
commit 1de5d69906

View File

@@ -240,7 +240,7 @@ def run_shell(cmd: str, timeout_seconds: int = SUBPROCESS_TIMEOUT_SECONDS) -> bo
def run_transform() -> None:
"""Run SQLMesh — evaluates model staleness internally."""
logger.info("Running SQLMesh transform")
ok = run_shell("uv run sqlmesh -p transform/sqlmesh_materia run")
ok = run_shell("uv run sqlmesh -p transform/sqlmesh_materia plan prod --auto-apply")
if not ok:
send_alert("SQLMesh transform failed")