Background
The scaffolding currently ships with SQLite as the default database (db.sqlite is committed to the repo and synchronize: true is likely set). Every C4C project eventually migrates to PostgreSQL on RDS, meaning new tech leads are doing unnecessary migration work and encountering TypeORM dialect differences mid-project.
Tasks
- Remove
db.sqlite from the repo and add it to .gitignore
- Remove any related sqlite type packages from
package.json
- Replace the TypeORM
DataSource config with a PostgreSQL driver (pg) using env-driven connection strings from example.env
- Set
synchronize: false and add a migrations/ directory with npm scripts for migration:generate, migration:run, and migration:revert. These exist just make sure they work properly.
- Update the README setup instructions to reflect the new local dev flow
Acceptance Criteria
nx serve backend works out of the box after creating a db through pgAdmin or docker and updating the connection strings in .env. SQLite has no remaining references in the codebase.
Background
The scaffolding currently ships with SQLite as the default database (
db.sqliteis committed to the repo andsynchronize: trueis likely set). Every C4C project eventually migrates to PostgreSQL on RDS, meaning new tech leads are doing unnecessary migration work and encountering TypeORM dialect differences mid-project.Tasks
db.sqlitefrom the repo and add it to.gitignorepackage.jsonDataSourceconfig with a PostgreSQL driver (pg) using env-driven connection strings fromexample.envsynchronize: falseand add a migrations/ directory with npm scripts formigration:generate,migration:run, andmigration:revert. These exist just make sure they work properly.Acceptance Criteria
nx serve backendworks out of the box after creating a db through pgAdmin or docker and updating the connection strings in.env. SQLite has no remaining references in the codebase.