Scaffolded app ships no initial migration — first deploy against an empty database creates no schema#4958
Problem
A fresh app created with @vendure/create ships with dbConnectionOptions.synchronize: false and a migrations glob, but no migration files. As a result, the first deployment against a fresh/empty production database creates no tables — the schema is never built, and nothing in the flow explains why.
This is currently masked during local development because @vendure/create force-sets synchronize: true while populating the seed data, so the local schema is created by synchronize, not by a migration. The gap therefore only surfaces on the first real deployment, where nothing turns synchronize on.
The manual workaround — temporarily enabling synchronize: true for the first deploy, or hand-generating an initial migration against a throwaway empty database — is not something a first-time user would know to do, and synchronize: true is not acceptable for production.
Root cause
generateMigration() produces a migration by diffing the entity metadata against whatever database is currently connected (TypeORM's SchemaBuilder.log()):
- against an empty database → the diff is the full schema (exactly the "initial migration" we want);
- against a populated database → the diff is empty, so no migration can be generated.