7 Schema Smells in AI-Generated Apps (and Which Ones Actually Mean “Rebuild”)
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.”
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
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.user_id on tables that belong to usersteam_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.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.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.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.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
userId field on every document; status is a single field; history is an events subcollection. The Firebase rules depend on getting these right.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.
