{# Schema Watch panel — HTMX partial loaded into the Schema page.
Context: connection_id, latest (snapshot dict or None), changes (list). #}
Schema watch
{% if latest %}
{{ latest.taken_at[:16].replace('T', ' ') }} UTC
{% else %}
not watched yet
{% endif %}
{% if latest %}
{{ latest.table_count }} tables · {{ latest.column_count }} columns in the last snapshot.
Schedule it under Scheduled → Schema watch to get notified on changes.
{% else %}
Take a first snapshot; every later check reports what changed (tables, columns, types, keys, indexes)
and raises schema.changed for your notification channels.
{% endif %}
{# ── Data contract ─────────────────────────────────────── #}
{% if contract %}
Contract{{ contract.name }} · {{ contract.table_count }} tables
{% if violation %}
violated
{% else %}
holds
{% endif %}
{% else %}
No contract. Freeze the current schema to be told when something breaks it.
{% endif %}
{% if contract %}
{# Confirmation through tuskConfirm (Alpine modal), never the native confirm(). #}
{% endif %}