| 1 | 1 | <div class="page-head"> |
| 2 | 2 | <span class="page-eyebrow"><span class="dot"></span> Monitor</span> |
| 3 | 3 | <h1 class="page-title">Schema changes</h1> |
| 4 | 4 | <p class="page-subtitle">Every DDL change captured across every monitored database. Someone ALTERs a column? It shows up here whether they told you or not.</p> |
| 5 | 5 | </div> |
| 6 | 6 | |
| 7 | | <form method="get" action="/schema_changes.cgi" style="display:flex;gap:8px;align-items:center;margin-bottom:12px"> |
| 7 | $picker_html |
| 8 | |
| 9 | <form method="get" action="/schema_changes.cgi" style="display:flex;gap:8px;align-items:center;margin-bottom:16px"> |
| 8 | 10 | <span class="rb-label" style="font-size:11px;letter-spacing:1.4px;text-transform:uppercase;color:var(--text-muted);font-weight:700">Table filter</span> |
| 9 | 11 | <input type="text" name="q" value="$q" placeholder="db or table name substring" style="flex:1;background:var(--bg-2);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:6px 12px;font-size:12.5px;font-family:inherit"> |
| 10 | 12 | <button type="submit" class="tr-chip is-active" style="border:none">Apply</button> |
| 11 | 13 | [if:$q]<a class="tr-chip" href="/schema_changes.cgi">Clear</a>[/if] |
| 12 | 14 | </form> |
| 13 | | |
| 14 | | $picker_html |
| 15 | 15 | |
| 16 | 16 | <div class="module glow-amber"> |
| 17 | | <!-- Status filter tabs --> |
| 18 | | <div class="fc-tabs"> |
| 19 | | <a href="?status=modified$tab_qs_extra" class="fc-tab[if:$tab_modified_active] fc-tab-active[/if]" data-tab="modified"> |
| 20 | | <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"/></svg> |
| 21 | | <span>Modified</span> |
| 22 | | <span class="fc-tab-badge">$tab_modified_count</span> |
| 23 | | </a> |
| 24 | | <a href="?status=added$tab_qs_extra" class="fc-tab[if:$tab_added_active] fc-tab-active[/if]" data-tab="added"> |
| 25 | | <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg> |
| 26 | | <span>Added</span> |
| 27 | | <span class="fc-tab-badge">$tab_added_count</span> |
| 28 | | </a> |
| 29 | | <a href="?status=deleted$tab_qs_extra" class="fc-tab[if:$tab_deleted_active] fc-tab-active[/if]" data-tab="deleted"> |
| 30 | | <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"/></svg> |
| 31 | | <span>Deleted</span> |
| 32 | | <span class="fc-tab-badge">$tab_deleted_count</span> |
| 33 | | </a> |
| 34 | | <a href="?status=all$tab_qs_extra" class="fc-tab[if:$tab_all_active] fc-tab-active[/if]" data-tab="all"> |
| 35 | | <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"/></svg> |
| 36 | | <span>All</span> |
| 37 | | <span class="fc-tab-badge">$tab_all_count</span> |
| 38 | | </a> |
| 39 | | </div> |
| 40 | | <div class="module-head" style="border-top:0"><div class="left"> |
| 17 | <div class="module-head"><div class="left"> |
| 41 | 18 | <div class="module-icon"><svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5v6c0 1.7 4 3 9 3s9-1.3 9-3V5"/></svg></div> |
| 42 | | <div class="module-title">DDL diffs[if:$show_baseline] <span class="pill pill-mute" style="font-size:10px;margin-left:6px">baseline shown</span>[/if]</div> |
| 43 | | <span class="module-subtitle"> |
| 44 | | Each row shows what the schema looked like before and after. Click to see the full unified diff of column adds, drops, and alters. $total match this window. |
| 45 | | [if:$has_baseline_hidden] |
| 46 | | · <a href="?baseline=1" style="color:var(--accent-hi);text-decoration:none">$baseline_hidden baseline capture[if:$has_baseline_hidden]s[/if] hidden</a> |
| 47 | | <span class="ds-help" data-help-title="Baseline schema captures" data-help-body="When a table is first seen (or after a fresh DB wipe), DriftSense captures its DDL as a baseline (<code>first snapshot</code>). Those rows are marked <code>is_baseline=1</code> and hidden by default because they aren't real schema changes -- they're the starting state. Click the link to see them anyway."></span> |
| 48 | | [/if] |
| 49 | | [if:$show_baseline] |
| 50 | | · <a href="?" style="color:var(--accent-hi);text-decoration:none">Hide baseline</a> |
| 51 | | [/if] |
| 52 | | </span> |
| 19 | <div class="module-title">DDL diffs</div> |
| 20 | <span class="module-subtitle">Each row shows what the schema looked like before and after. Click to see the full unified diff of column adds, drops, and alters. $total match this window.</span> |
| 53 | 21 | </div></div> |
| 54 | 22 | <div class="module-body tight"> |
| 55 | 23 | [if:$has_rows] |
| 56 | 24 | <table class="tbl"> |
| 57 | 25 | <thead><tr> |
| 58 | 26 | <th style="width:220px">Database.Table</th> |
| 59 | 27 | <th>Change</th> |
| 60 | 28 | <th style="width:110px">30-day rhythm</th> |
| 61 | 29 | <th style="width:110px">Server</th> |
| 62 | 30 | <th style="width:180px">When</th> |
| 63 | 31 | </tr></thead> |
| 64 | 32 | <tbody> |
| 65 | 33 | [loop:@rows] |
| 66 | 34 | <tr> |
| 67 | 35 | <td class="mono"><a href="$diff_url" style="color:var(--accent-hi);text-decoration:none"><strong>$database_name</strong>.<span class="dim">$table_name</span></a></td> |
| 68 | 36 | <td class="mono dim" style="font-size:12px"><a href="$diff_url" style="color:inherit;text-decoration:none">$changes_preview</a></td> |
| 69 | 37 | <td>$sparkline_svg</td> |
| 70 | 38 | <td class="dim">$server_name</td> |
| 71 | 39 | <td class="mono dim"><span class="ts" data-ts="$ts_epoch" data-fmt="datetime">$change_datetime</span></td> |
| 72 | 40 | </tr> |
| 73 | 41 | [/loop] |
| 74 | 42 | </tbody> |
| 75 | 43 | </table> |
| 76 | 44 | [/if] |
| 77 | 45 | [if:!$has_rows] |
| 78 | 46 | <div style="padding:36px 14px;text-align:center;color:var(--text-dim);font-size:13.5px"> |
| 79 | 47 | No schema changes captured in this window. Try widening the range with the chips above, or configure a database monitor in <a href="[url:databases]" style="color:var(--accent-hi)">Databases</a>. |
| 80 | 48 | </div> |
| 81 | 49 | [/if] |
| 82 | 50 | </div> |
| 83 | 51 | </div> |