Detect missing tables in DB health check and always show schema fix button

This commit is contained in:
Troll (Hermes Agent) 2026-08-04 16:59:54 +00:00
parent cda4d57859
commit a3fd5938a5
2 changed files with 29 additions and 11 deletions

View file

@ -201,17 +201,24 @@
<!-- Database health check -->
<div class="section">
<h2>Database Health</h2>
{% if health.ok %}
<p class="status-ok">✅ {{ health.message }}</p>
{% else %}
{% if not health.ok %}
<p class="status-bad">❌ {{ health.message }}</p>
{% if health.missing_columns %}
<p>Missing columns: {{ health.missing_columns | join(', ') }}</p>
{% endif %}
{% if health.missing_tables %}
<p>Missing tables: {{ health.missing_tables | join(', ') }}</p>
{% endif %}
<form method="POST" action="{{ url_for('admin_settings') }}">
<input type="hidden" name="action" value="fix_db">
<button type="submit">Fix Missing Columns</button>
<button type="submit">Fix Database Schema</button>
</form>
{% else %}
<p class="status-ok">✅ {{ health.message }}</p>
<form method="POST" action="{{ url_for('admin_settings') }}" style="margin-top:.5rem">
<input type="hidden" name="action" value="fix_db">
<button type="submit" class="secondary">Recheck / Apply Schema</button>
</form>
{% endif %}
{% endif %}
</div>