Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
backend ruleP1stack specificStack: TypeORM / SQL
databasemigrationsschemaorm
Generate a migration whenever entity schema changes
Renaming or altering entity columns requires a corresponding generated migration so the database stays in sync with the model definitions.
PR: hegnar-shareholders-ws · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | // entity edited, no migration created |
| 2 | investorId!: string; // was investor_Id |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // entity edited AND migration generated |
| 2 | // migrations/<ts>-rename-investor-id.ts created via `typeorm migration:generate` |
Explanation (EN)
Objašnjenje (HR)