The data
What KarmaCircle stores and how the main pieces of data connect.
All of KarmaCircle's data lives in one PostgreSQL database. Here is what it keeps, in plain words.
How the main data connects
What each table holds
| Table | Holds | Kept for |
|---|---|---|
users | every login, personal and organization | as long as the account exists |
organizations | each organization's profile | as long as it exists |
organization_follows | who follows which organization | until unfollowed |
organization_analytics_events | single profile visits, with no visitor details | one year |
organization_view_daily | profile visits added up per day | for good |
events | events, including drafts and cancelled ones | for good; drafts until deleted |
event_registrations | one row per person per event | for good; deleted if the person leaves before the start |
event_invites | email invitations to events | until taken back |
payment_orders | support payments | for good |
jobs | the background queue, including emails waiting to go out | 7 days after done, 30 days if failed |
rate_limits | counters that stop too many requests | until the time window ends |
Who sees each piece, and which outside services receive it: Your data, in one place.
Good to know
- Money is stored in paise (100 paise = 1 rupee), so nothing is lost to rounding.
- Passwords are stored only as one-way hashes.
- Each email address and each organization handle can be used only once.
- Tables are defined with Drizzle in each module's
*.model.tsand exported fromapps/api/src/db/schema.ts. - Change the schema, run
pnpm --filter karmacircle-api db:generate, and commit the generated SQL migration. Never edit generated migration metadata. - Migrations must work with the code already running: add first, remove or rename in a later release.
- Related tables point at
organizations.handleandusers.email;payment_ordersusesrestricton delete.