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: node
ormsequelizemodelschema
Define explicit column types, table name and primary key in ORM models
Don't leave an ORM model relying on inference; declare the table name, primary key, and each column's DB data type explicitly.
PR: profico-mining-2026-06Created: Jul 26, 2026
Bad example
Old codetypescript
| 1 | @Table class Task extends Model { @Column id; @Column title; } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | @Table({ tableName: "tasks" }) class Task extends Model { |
| 2 | @PrimaryKey @Column(DataType.BIGINT) id: number; |
| 3 | @Column(DataType.STRING) title: string; |
| 4 | } |
Explanation (EN)
Objašnjenje (HR)