When adding a new JSONB column to the database schema, it is important to ensure type safety and maintainability by defining the corresponding TypeScript type. Follow these steps:
By following these steps, you ensure that the JSONB column is type-safe and maintainable, leveraging TypeScript's compile-time checks and IntelliSense support.
Always use `InferSelectModel` for deriving types from table definitions:
```typescript
import { type InferSelectModel } from 'drizzle-orm';
export type User = InferSelectModel<typeof users>;
```
This ensures types stay in sync with the database schema automatically.
By following these steps, you ensure that the JSONB column is type-safe and maintainable, leveraging TypeScript's compile-time checks and IntelliSense support.