Description
Wire the database connection using the env vars documented in astre_server/.env.example, rather than hardcoded config.
Where
astre_server/src/app.module.ts (or a separate astre_server/src/db.config.ts helper, following whatever pattern feels cleanest — a small helper function is fine)
What to implement
Read DATABASE_URL if set; otherwise fall back to individual DB_HOST/DB_PORT/DB_USER/DB_PASSWORD/DB_NAME vars. Pass the result to TypeOrmModule.forRoot({ ..., synchronize: false, entities: [...], migrations: [...] }) — synchronize must stay false, see Hints.
Acceptance Criteria
Hints
synchronize: false is deliberate, not an oversight — the schema is only ever changed by running a migration (see the migration-writing issues). Setting this true, even temporarily while developing, risks the database silently drifting from what the migrations describe.
Description
Wire the database connection using the env vars documented in
astre_server/.env.example, rather than hardcoded config.Where
astre_server/src/app.module.ts(or a separateastre_server/src/db.config.tshelper, following whatever pattern feels cleanest — a small helper function is fine)What to implement
Read
DATABASE_URLif set; otherwise fall back to individualDB_HOST/DB_PORT/DB_USER/DB_PASSWORD/DB_NAMEvars. Pass the result toTypeOrmModule.forRoot({ ..., synchronize: false, entities: [...], migrations: [...] })—synchronizemust stayfalse, see Hints.Acceptance Criteria
DATABASE_URLalone, or the individualDB_*varssynchronize: falseis explicitly set (never implicitly rely on the default)Pool,Donation,SyncState) are registeredHints
synchronize: falseis deliberate, not an oversight — the schema is only ever changed by running a migration (see the migration-writing issues). Setting thistrue, even temporarily while developing, risks the database silently drifting from what the migrations describe.