Thank you for contributing to Lumentix! Please read these guidelines before opening a pull request.
Lumentix uses TypeORM migrations exclusively for all schema changes. DB_SYNCHRONIZE must never be enabled in any environment other than local development sandboxes, and even then it is strongly discouraged.
Whenever you change a TypeORM entity (add/remove/rename a column, change a type, add an index, etc.) you must generate a migration:
cd backend
npm run migration:generate -- -n DescriptiveMigrationNameThis creates a timestamped file under src/database/migrations/. Review the generated SQL before committing.
# Apply all pending migrations
npm run migration:run
# Revert the last migration
npm run migration:revertThe CI pipeline runs npm run check-migrations after the build step to ensure no entity change was left without a corresponding migration. If this check fails your PR will not merge.
npm run check-migrationsSetting DB_SYNCHRONIZE=true lets TypeORM alter the database schema automatically at startup. This is dangerous in production because:
- It can silently drop columns or tables.
- It bypasses the reviewed migration history.
- It makes rollbacks impossible.
Always use npm run migration:generate for entity changes and commit the resulting migration file to the repository.
- Follow the existing NestJS module/service/controller structure.
- Run
npm run lintbefore pushing. - Run
npm testto verify nothing is broken.
- Reference the GitHub issue number in the PR title or description (
Closes #NNN). - Keep PRs focused — one feature or fix per PR.
- Add or update tests for every changed behaviour.