src/config/database.config.ts sets synchronize: process.env.NODE_ENV !== 'production'. Now that a baseline migration exists (#1193) and migrations own the schema, any non-production env (dev, staging, CI where NODE_ENV isn't exactly production) that boots the app with TypeOrmModule.forRoot(getDatabaseConfig()) will have TypeORM synchronize the schema — which, given the entity↔migration drift in #1194, will drop migration-managed columns (e.g. users.country_code, course.currency, user_preferences.currency) because the entities don't declare them.
Fix: default synchronize to false everywhere and rely on migrations (optionally keep a narrowly-scoped dev-only opt-in via an env flag).
src/config/database.config.tssetssynchronize: process.env.NODE_ENV !== 'production'. Now that a baseline migration exists (#1193) and migrations own the schema, any non-production env (dev, staging, CI where NODE_ENV isn't exactlyproduction) that boots the app withTypeOrmModule.forRoot(getDatabaseConfig())will have TypeORMsynchronizethe schema — which, given the entity↔migration drift in #1194, will drop migration-managed columns (e.g.users.country_code,course.currency,user_preferences.currency) because the entities don't declare them.Fix: default
synchronizetofalseeverywhere and rely on migrations (optionally keep a narrowly-scoped dev-only opt-in via an env flag).