menstrual_phase, illness, antihistamine, nsaid, alcohol, etc.
value
string
e.g. “luteal”, “true”, “10mg”
Separate extensible table — no schema changes needed to add new confounder types.
Hypothesis Engine
hypothesis_suggestions
Column
Type
Notes
id
bigint
PK
user_id
bigint
FK → users
suggested_food_id
bigint
FK → foods
reason_category_id
bigint
FK → food_sensitivity_categories
status
integer
enum: pending=0, accepted=1, rejected=2
Integrations
connected_integrations
Column
Type
Notes
id
bigint
PK
user_id
bigint
FK → users
provider
string
apple_health, google_fit, cronometer, clue, etc.
access_token
string
Encrypted
refresh_token
string
Encrypted
scopes
string
last_synced_at
datetime
integration_sync_logs
Column
Type
Notes
id
bigint
PK
connected_integration_id
bigint
FK → connected_integrations
synced_at
datetime
records_imported
integer
status
string
success / error
Future: Lab Results
lab_results
Column
Type
Notes
id
bigint
PK
user_id
bigint
FK → users
collected_at
datetime
provider
string
lab_result_markers
Column
Type
Notes
id
bigint
PK
lab_result_id
bigint
FK → lab_results
marker_name
string
”DAO”, “plasma_histamine”, “urinary_oxalate”, etc.
value
decimal
unit
string
reference_range_low
decimal
reference_range_high
decimal
flag
string
normal / low / high
sensitivity_category_id
bigint
FK → food_sensitivity_categories, nullable
sensitivity_category_id links lab markers directly to the category graph. A low DAO result → histamine category → boosts confidence of histamine hypothesis suggestions.