Skip to content

Status-colored DDL diff + Execute safety gates (all dialects) - #14

Merged
huyplb merged 2 commits into
mainfrom
feat/diff-colors-and-safety-gates
Jul 1, 2026
Merged

Status-colored DDL diff + Execute safety gates (all dialects)#14
huyplb merged 2 commits into
mainfrom
feat/diff-colors-and-safety-gates

Conversation

@huyplb

@huyplb huyplb commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • DDL diff orientation & color: left pane = Source (original), right pane = Target (destination) — matches the Source/Target connection panel order in the toolbar. Diff highlight color now signals what the migration will do to the object rather than a fixed add/remove pair: 🟢 green = new object, 🟠 amber = modified, 🔴 red = dropped. Driven entirely by TableDiff.status, so it's dialect-agnostic — applies identically across all 10 dialects.

  • Execute button safety gates: four risk signals that previously only showed a dismissible warning now actively block Execute until resolved:

    • Drop-dependency conflicts (dropped table/column still referenced by a view/function/procedure staying in target) — removed the one-click "Deploy anyway" bypass; must include the dependent or deselect the drop.
    • Destructive drops (DROP TABLE/COLUMN/INDEX) with non-destructive mode off — requires an explicit checkbox acknowledgment.
    • Unhealthy target connection — hard block, no bypass.
    • MySQL/MariaDB routine/trigger + binlog privilege risk — requires an explicit checkbox acknowledgment.

    Acknowledgment checkboxes are keyed to the exact generatedSql they were ticked against, so any change to the migration plan (new selection, toggling non-destructive) silently invalidates a stale checkbox instead of carrying forward consent for a plan the user never actually saw.

See docs/plans/2026-06-30-diff-colors-and-safety-gates.md for the full writeup.

Test plan

  • cd apps/web && npx tsc --noEmit — clean
  • npx vitest run — 92/92 passing
  • Live browser verification against seeded MySQL demo_a/demo_b:
    • ADDED object → green diff, "new object" legend
    • MODIFIED object → amber diff, "modified" legend
    • REMOVED object → red diff, "dropped" legend
    • Selecting all objects (destructive drops + MySQL routine creation both present) → Execute disabled with both acknowledgment checkboxes shown; ticking both unlocks Execute
  • Dependency-conflict and target-connection gates verified by code review — reuse the pre-existing findDropDependencies scan and targetConnected store field already used elsewhere in the app

🤖 Generated with Claude Code

huyplb and others added 2 commits June 30, 2026 22:34
- DDL diff: left=Source(original)/right=Target(destination) to match the
  toolbar's connection panel order; diff highlight now signals what the
  migration will do (green=new object, amber=modified, red=dropped) instead
  of a fixed add/remove color pair. Driven entirely by TableDiff.status, so
  it applies uniformly across all 10 dialects with no per-dialect branching.
- Execute button: four existing risk signals that only warned now actively
  block the button until resolved — drop-dependency conflicts (removed the
  one-click "Deploy anyway" bypass), destructive drops without
  non-destructive mode, an unhealthy target connection, and MySQL/MariaDB
  routine+binlog privilege risk. The two acknowledgment checkboxes are keyed
  to the exact generatedSql they were ticked against, so any plan change
  invalidates a stale acknowledgment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eslint/js was never imported in eslint.config.js — the config uses only
typescript-eslint's parser and eslint-plugin-security, no @eslint/js rules.
A recent @eslint/js@10.0.1 release requires eslint@^10.0.0 as a peer, which
conflicts with the pinned eslint@^9.0.0, breaking every CI job that runs
npm install fresh (no lockfile is committed). Removing the unused dep
resolves the ERESOLVE conflict without touching the actual lint toolchain.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@huyplb
huyplb merged commit 29ef3ad into main Jul 1, 2026
4 checks passed
@huyplb
huyplb deleted the feat/diff-colors-and-safety-gates branch July 1, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant