Skip to content

Data Models

The bot uses PostgreSQL with TypeORM. All entities live in entities/ and are auto-discovered at startup. The schema breaks into five domains:

DomainTablesDescription
Characterscensus, active_toons (view), status (view)Guild member character records
DKP & Raidsdkp, attendance, raids, itemsDragon Kill Points and raid attendance
Bank & Platbank, inventory, trash, platGuild bank inventory and platinum ledger
Game Referenceclass_definitions, class_lore, class_roles, racesStatic EverQuest lookup data
Shared Accountsshared_accounts, shared_toons, self_rolesShared guild accounts and self-assignable roles

  • Primary keys are auto-generated bigint columns named Id (except raids, which uses Raid as a text PK).
  • Discord IDs are stored as text — Discord snowflakes exceed JavaScript’s Number.MAX_SAFE_INTEGER.
  • Timestamps use timestamp without time zone (except plat, which uses with time zone).
  • Views (active_toons, status) are read-only projections of census defined via TypeORM’s @ViewEntity.
  • The only foreign-key relationship is shared_toonsshared_accounts (many-to-one on the account column).