Will It Vibe logoWill It Vibe?
SQL-009Low severity-4 points

DROP TABLE without an IF EXISTS guard

Part of Architecture & Best Practices, which counts for 15% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.

What it detects

DROP TABLE with no IF EXISTS fails the whole migration run if the table is already gone (a partial prior run, a manual hotfix, replaying migrations against a fresh database). This is a best-practice heuristic: some teams deliberately want a hard failure here.

Why it matters

DROP TABLE with no IF EXISTS aborts the whole migration run with an error if the table is already gone, for example after a partially-applied prior run, a manual hotfix, or replaying migrations against a freshly created database. That failure can leave the schema in a half-migrated state that is harder to diagnose than the missing table itself. This is a best-practice heuristic: a hard failure here is sometimes exactly what a team wants as a sanity check.

How to fix it

Add IF EXISTS so the statement is a no-op when the table is already absent, unless your migration tooling deliberately relies on the statement failing to catch drift, in which case leave it and document why.

The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing

Does your repo trip this check?

Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.

Scan your repo

Related Architecture & Best Practices checks