Database Naming Conventions
Column Names
All columns use snake_case:
organization_id -- NOT organizationId
created_at -- NOT createdAt
is_active -- NOT isActive
TypeORM Mapping
Always use explicit column names:
@Column({ name: 'organization_id' })
organizationId: string;
@Column({ name: 'is_active', default: true })
isActive: boolean;
@CreateDateColumn({ name: 'created_at' })
createdAt: Date;
Table Names
- Plural, snake_case:
organizations,status_pages,alert_events - Schema prefix in entity:
@Entity({ schema: 'alerts', name: 'users' })
Boolean Columns
Use is_ prefix: is_active, is_public, is_employee