Skip to main content

Schema Overview

Tonnex uses Drizzle ORM for type-safe database access. All schemas live in packages/db/src/schema/.

Schema Files

Conventions

  • Table names: snake_case (plural)
  • Column names: snake_case in DB, camelCase in TypeScript
  • Every table has org_id (except system tables)
  • Primary keys: UUID with defaultRandom()
  • Timestamps: created_at and updated_at with timezone

Running Migrations