Fix: register plugin routes in create_app() not lifespan(); add status column to contacts migration 0039; add updated_at to user_tenants migration 0037

This commit is contained in:
Agent Zero
2026-07-26 00:42:31 +02:00
parent 07da2216b6
commit 054ecb1c91
3 changed files with 30 additions and 9 deletions
@@ -54,6 +54,11 @@ def _constraint_exists(table: str, constraint: str) -> str:
def upgrade() -> None:
conn = op.get_bind()
# ── 0. Add status column to contacts (for state machine) ──
status_col = conn.execute(sa.text(_column_exists("contacts", "status"))).fetchone()
if not status_col:
op.add_column("contacts", sa.Column("status", sa.String(20), nullable=False, server_default="lead"))
# ── 1a. Rename surfix → suffix ──
result = conn.execute(sa.text(_column_exists("contacts", "surfix"))).fetchone()
if result: