Vibe Coding Rescue

7 Schema Smells in AI-Generated Apps (and Which Ones Actually Mean “Rebuild”)

8 min read | Updated September 2026

Every other article in this series says the same thing in passing: the one check that decides harden-or-rebuild is whether the data model can carry the roadmap. This is that check, written out. Seven schema smells we find in AI-generated apps, what each one costs you later, and — because most of them are fixable in an afternoon — which ones actually justify the word “rebuild.”

How to look

Open your database’s table view (Supabase Table Editor, Prisma schema, Firestore collections) and read it like a stranger would. Can you tell what the product does from the tables alone? Can you find where a user’s data lives, and where “who owns what” is recorded? If either takes more than a minute, keep reading.

The seven smells

1
The JSON blob that’s really five tables
A data or settings or content column holding an object with arrays inside it — the AI’s favourite way to avoid designing tables. Cost: you can’t query it, index it, validate it or secure parts of it. Fix: promote anything you filter, sort, count or share into real columns and tables. Afternoon-to-a-day.
2
No user_id on tables that belong to users
Ownership is inferred by joining through three other tables, or stored on a parent only. Cost: row-level security policies become slow, recursive or impossible; every query has to reconstruct ownership. Fix: denormalise the owner onto each owned table, backfill, make it not-null. Afternoon.
3
Single-tenant schema in a multi-tenant product
The app was built for “me and my stuff,” then teams were bolted on by adding a team_id to some tables and not others. Cost: data leaks between teams, “who can see this” has no consistent answer, and every new feature has to re-solve it. Fix: this is the one that most often means re-spine. An organisation/membership model has to be first-class, and everything owned has to hang off it.
4
Roles as free-text strings on the user
role: "admin" — writable by the client, checked with string comparisons scattered through the code, no concept of a role within a team. Cost: privilege escalation, and the moment you need “admin of team A, viewer of team B” it all has to change. Fix: a memberships table with a role column, server-only writes. Half a day, more if permissions are checked in many places.
5
Money as floats, dates as strings
price: 19.99 in a float column; created_at: "9/8/2026" as text. Cost: rounding errors that surface in invoices, and dates that sort wrong and break across timezones. Fix: integer minor units (cents) for money; timestamp-with-timezone for dates. Mechanical, but every reader of those columns has to change. A day.
6
Status as booleans instead of a state
is_paid, is_cancelled, is_active, is_trial — four flags that can all be true at once. Cost: impossible states, and code full of “if paid and not cancelled and not …”. Fix: one status column with an allowed set of values and the transitions written down. Half a day, and it usually simplifies the code that reads it.
7
No history where the business needs it
The subscription row is overwritten on every change; the order is updated in place; the price is edited and every past invoice changes with it. Cost: you cannot answer “what did this customer have on the 3rd,” which is the first question support, finance and a dispute will ask. Fix: append-only event or history tables for the entities that matter (subscriptions, orders, prices). A day, and it pairs with the webhook patterns that produce those events.

So which ones mean “rebuild”?

Only number 3, and only sometimes. Smells 1, 2, 4, 5, 6 and 7 are each a migration and a code sweep — real work, but additive, and they can be done one at a time while the product keeps running. The multi-tenancy smell is different because it changes the shape of every table and every policy. If you’re single-tenant today and the roadmap is single-tenant for six months, leave it. If teams, workspaces or agencies-managing-clients are on the roadmap, fix it now, before more tables hang off the wrong spine.

This is the distinction we draw in the 12-point prototype audit and it’s why most vibe-coded apps land in the hardening tier of the cost breakdown rather than the rebuild one: the schema is usually salvageable, and the logic on top of it is usually fine.

How to do the migration without losing data

Every fix above follows the same shape: add the new column or table, backfill from the old, switch the code to read the new, verify, then drop the old. Never in one step, never on production without a backup you’ve actually restored. Use a staging database seeded from a production snapshot, and run the migration there first with the AI watching the errors. If you’re on a builder platform where you can’t do this safely, that’s a reason to move to a repo before touching the schema.

FAQ

Can the AI fix these itself?
It can write the migrations well once you name the smell and the target shape. It is bad at deciding whether to, and at judging what the roadmap needs. Point it at one smell at a time, review the migration, and run it on staging first.
My app is on Firestore. Do these apply?
Yes, translated: the JSON blob is a document that should be a subcollection; ownership is a userId field on every document; status is a single field; history is an events subcollection. The Firebase rules depend on getting these right.
Is it worth fixing smells that aren’t hurting yet?
Fix the ones on the path of your next three features. Leave the rest, but write them down so they’re a known decision rather than a surprise.
How long does a schema review take?
For a typical AI-built SaaS: a few hours to read the schema against the roadmap and produce a ranked list with a harden/re-spine verdict. It’s the highest-leverage part of the diagnostic.

Want the schema read against your roadmap?

A short schema review is the most valuable part of our diagnostic: a ranked list of smells, the migration order, and a clear harden-or-re-spine verdict.

Book a Schema Review →

Engineering Insights

Latest from Syntaxa Studio.

Loading latest posts