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:
| Domain | Tables | Description |
|---|---|---|
| Characters | census, active_toons (view), status (view) | Guild member character records |
| DKP & Raids | dkp, attendance, raids, items | Dragon Kill Points and raid attendance |
| Bank & Plat | bank, inventory, trash, plat | Guild bank inventory and platinum ledger |
| Game Reference | class_definitions, class_lore, class_roles, races | Static EverQuest lookup data |
| Shared Accounts | shared_accounts, shared_toons, self_roles | Shared guild accounts and self-assignable roles |
Key Conventions
Section titled “Key Conventions”- Primary keys are auto-generated
bigintcolumns namedId(exceptraids, which usesRaidas a text PK). - Discord IDs are stored as
text— Discord snowflakes exceed JavaScript’sNumber.MAX_SAFE_INTEGER. - Timestamps use
timestamp without time zone(exceptplat, which useswith time zone). - Views (
active_toons,status) are read-only projections ofcensusdefined via TypeORM’s@ViewEntity. - The only foreign-key relationship is
shared_toons→shared_accounts(many-to-one on theaccountcolumn).