Data model

Every table the database has, from the migration snapshot drizzle-kit writes out of the schema — so this page cannot disagree with the schema, and a column added without a migration does not appear here because it does not exist.

90 tables.

Table Columns Belongs to a user
account 13 yes
activities 9 yes
album_media 6 yes
albums 6 yes
api_tokens 14 yes
assistant_calls 11 yes
audit_events 7 yes
bill_payments 13 yes
billing_checkouts 8 yes
billing_events 8 —
bills 20 yes
calendar_feeds 9 yes
categories 5 yes
client_errors 9 yes
daily_wins 6 yes
data_points 10 yes
data_streams 14 yes
diary_entries 14 yes
diary_entry_tags 5 yes
entry_people 4 yes
exceptional_task_tags 5 yes
exceptional_tasks 19 yes
finance_balance_checks 7 yes
finance_budgets 8 yes
finance_commitment_entries 8 yes
finance_commitments 11 yes
finance_rules 8 yes
finance_transaction_allocations 9 yes
finance_transactions 13 yes
goal_areas 6 yes
goal_events 9 yes
goal_links 6 yes
goal_targets 9 yes
goals 15 yes
habit_occurrences 6 yes
habits 9 yes
idea_tags 4 yes
ideas 10 yes
inventory_attribute_colors 5 yes
inventory_categories 8 yes
inventory_items 18 yes
invites 9 —
ledgers 13 yes
locations 8 yes
mail_failures 11 —
media 11 yes
media_tags 4 yes
model_provider_keys 9 yes
newsletter_issues 6 —
notebook_favourites 4 yes
notebooks 13 yes
oauth_clients 7 —
oauth_codes 11 yes
people 12 yes
phone_widgets 11 yes
plan_members 5 —
planning_schemes 5 yes
plugin_manifests 8 yes
price_points 6 yes
push_subscriptions 9 yes
quotes 5 yes
recipe_images 7 yes
recipe_items 8 yes
recipes 13 yes
recurring_task_tags 5 yes
recurring_tasks 21 yes
reminder_sounds 7 yes
reminders 12 yes
request_replays 7 yes
ringtones 7 yes
scheme_slots 11 yes
sent_notifications 8 yes
session 9 yes
subscribers 7 —
subscriptions 15 yes
suppressed_slots 5 yes
tags 5 yes
task_records 15 yes
todo_tags 5 yes
todo_tasks 20 yes
user 12 —
user_settings 4 yes
verification 6 —
webhook_subscriptions 11 yes
weekly_reviews 7 yes
workout_categories 5 yes
workout_measures 7 yes
workout_plan_measures 6 yes
workout_sessions 7 yes
workouts 12 yes

account

Column Type Null Default Notes
id text not null — primary key
account_id text not null — —
provider_id text not null — —
user_id text not null — → user.id
access_token text null — —
refresh_token text null — —
id_token text null — —
access_token_expires_at integer null — —
refresh_token_expires_at integer null — —
scope text null — —
password text null — —
created_at integer not null (cast(unixepoch('subsecond') * 1000 as integer)) —
updated_at integer not null — —

Indexes:

activities

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
category_id integer not null — → categories.id
description text null '' —
color text null '' —
active integer not null true —
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

album_media

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
album_id integer not null — → albums.id
media_id integer not null — → media.id
position integer not null 0 —
added_at text not null (CURRENT_TIMESTAMP) —

Indexes:

albums

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
sort_order integer not null 0 —
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

api_tokens

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
token_hash text not null — —
prefix text not null — —
plaintext text null — —
scopes text not null '' —
confined_kind text null — —
confined_id integer null — —
last_used_at text null — —
expires_at text null — —
revoked_at text null — —
created_at text not null — —
updated_at text not null — —

Indexes:

assistant_calls

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
token_id integer null — —
tool text not null — —
args text not null '{}' —
before text null — —
destroyed integer not null false —
subject_kind text null — —
subject_id text null — —
restored_at text null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

audit_events

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text null — → user.id
actor_id text null — —
event text not null — —
detail text not null '{}' —
ip text null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

bill_payments

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
bill_id integer not null — → bills.id
period text not null — —
amount_expected integer not null 0 —
amount_paid integer not null 0 —
status text not null 'paid' —
automatic integer not null false —
movement_id integer null — → finance_transactions.id
currency text null — —
paid_at text not null (CURRENT_TIMESTAMP) —
notes text null '' —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

billing_checkouts

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
provider text not null — —
provider_transaction_id text not null — —
settled_at text null — —
settled_by text null — —
webhook_seen_at text null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

billing_events

Column Type Null Default Notes
id integer not null — primary key, auto
provider text not null — —
event_id text not null — —
event_type text not null — —
payload text not null — —
processed_at text null — —
error text null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

bills

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
amount_expected integer not null 0 —
currency text null — —
due_day integer null — —
due_month integer null — —
pay_lead_days integer not null 0 —
automatic integer not null false —
settled_through text null — —
flow text not null 'out' —
rhythm text not null 'monthly' —
category_id integer null — → categories.id
goal_id integer null — → goals.id
notes text null '' —
active integer not null true —
sort_order integer not null 0 —
notebook_id integer null — → notebooks.id
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

Checks — enforced by the database, not only by the service layer:

calendar_feeds

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
url text not null — —
color text not null '#6b7280' —
body text null — —
fetched_at text null — —
last_error text null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

categories

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
color text not null '#6b7280' —
color_light text not null '#f3f4f6' —

Indexes:

client_errors

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text null — —
message text not null — —
url text null — —
stack text null — —
user_agent text null — —
build text null — —
kind text not null 'crash' —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

daily_wins

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
for_date text not null — —
position integer not null — —
content text not null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

data_points

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
stream_id integer not null — → data_streams.id
external_id text not null — —
at text not null — —
local_date text not null — —
value_num real null — —
value_text text null — —
meta text not null '{}' —
created_at text not null — —

Indexes:

data_streams

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
slug text not null — —
name text not null — —
source text not null — —
kind text not null — —
unit text not null '' —
display text not null 'list' —
config text not null '{}' —
show_on_dashboard integer not null false —
retention_days integer null — —
archived_at text null — —
created_at text not null — —
updated_at text not null — —

Indexes:

diary_entries

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
seq integer not null 0 —
notebook_seq integer null — —
diary_seq integer null — —
title text not null '' —
content text not null — —
for_date text null — —
notebook_id integer null — → notebooks.id
archived_at text null — —
pinned_at text null — —
color text null — —
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

diary_entry_tags

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
entry_id integer not null — → diary_entries.id
tag_id integer not null — → tags.id
tagged_at text null — —

Indexes:

entry_people

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
entry_id integer not null — → diary_entries.id
person_id integer not null — → people.id

Indexes:

exceptional_task_tags

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
task_id integer not null — → exceptional_tasks.id
tag_id integer not null — → tags.id
tagged_at text null — —

Indexes:

exceptional_tasks

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
date text not null — —
start_time text not null — —
duration_minutes integer not null 60 —
mode text not null — —
category_id integer null — → categories.id
activity_id integer null — → activities.id
label text null '' —
active integer not null true —
remind_lead_minutes integer null — —
notebook_id integer null — → notebooks.id
urgency integer null — —
interest integer null — —
ease integer null — —
attributes text not null '{}' —
recipe_id integer null — → recipes.id
workout_id integer null — → workouts.id
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

Checks — enforced by the database, not only by the service layer:

finance_balance_checks

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
ledger_id integer not null — → ledgers.id
as_of text not null — —
observed_minor integer not null — —
note text null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

finance_budgets

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
month text not null — —
category text not null — —
currency text not null — —
amount_minor integer not null — —
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

Checks — enforced by the database, not only by the service layer:

finance_commitment_entries

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
commitment_id integer not null — → finance_commitments.id
occurred_on text not null — —
amount_minor integer not null — —
transaction_id integer null — → finance_transactions.id
note text null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

Checks — enforced by the database, not only by the service layer:

finance_commitments

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
kind text not null — —
name text not null — —
person_id integer null — → people.id
currency text not null — —
opening_minor integer not null 0 —
notes text not null '' —
status text not null 'open' —
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

Checks — enforced by the database, not only by the service layer:

finance_rules

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
kind text not null — —
name text not null — —
pattern text not null — —
color text not null '#475569' —
position integer not null 0 —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

finance_transaction_allocations

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
transaction_id integer not null — → finance_transactions.id
kind text not null — —
amount_minor integer not null — —
category text null — —
commitment_id integer null — → finance_commitments.id
note text null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

Checks — enforced by the database, not only by the service layer:

finance_transactions

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
ledger_id integer null — → ledgers.id
occurred_on text not null — —
amount_cents integer not null — —
description text not null — —
source text not null — —
external_id text null — —
fingerprint text not null — —
kind text null — —
group_id text null — —
parent_id integer null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

goal_areas

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
color text not null '#6b7280' —
sort_order integer not null 0 —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

goal_events

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
goal_id integer not null — → goals.id
kind text not null — —
target_id integer null — → goal_targets.id
value real null — —
status text null — —
note text not null '' —
at text not null (CURRENT_TIMESTAMP) —

Indexes:

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
goal_id integer not null — → goals.id
slot_id integer null — → recurring_tasks.id
todo_id integer null — → todo_tasks.id
activity_id integer null — → activities.id

Indexes:

Checks — enforced by the database, not only by the service layer:

goal_targets

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
goal_id integer not null — → goals.id
target_value real not null — —
current_value real not null 0 —
unit text not null '' —
whole integer not null true —
measure_activity text null — —
sort_order integer not null 0 —

Indexes:

Checks — enforced by the database, not only by the service layer:

goals

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
area_id integer null — → goal_areas.id
notebook_id integer null — → notebooks.id
notebook_seq integer null — —
parent_id integer null — —
title text not null — —
notes text null '' —
horizon text not null — —
period_start text not null — —
status text not null 'open' —
outcome text null '' —
closed_at text null — —
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

habit_occurrences

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
habit_id integer not null — → habits.id
date text not null — —
notes text null '' —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

habits

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
description text null '' —
type text not null 'bad' —
scheduled_days text null '' —
notebook_id integer null — → notebooks.id
archived_at text null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

idea_tags

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
idea_id integer not null — → ideas.id
tag_id integer not null — → tags.id

Indexes:

ideas

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
content text not null — —
is_applied integer not null false —
applied_note text null — —
favorite integer not null false —
notebook_id integer null — → notebooks.id
notebook_seq integer null — —
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

inventory_attribute_colors

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
key text not null — —
value text not null '' —
color text not null — —

Indexes:

inventory_categories

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
shared_with_family integer not null false —
is_food integer not null false —
color text null — —
sort_order integer not null 0 —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

inventory_items

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
type text not null — —
inventory_category_id integer null — → inventory_categories.id
notes text null '' —
qty integer not null 0 —
ideal_qty integer not null 1 —
bought integer not null false —
bought_at text null — —
price_cents integer null — —
location_id integer null — → locations.id
attributes text not null '{}' —
snoozed integer not null false —
notebook_id integer null — → notebooks.id
picture_id integer null — → media.id
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

Checks — enforced by the database, not only by the service layer:

invites

Column Type Null Default Notes
id integer not null — primary key, auto
code text not null — —
note text null '' —
created_by text not null — —
expires_at text null — —
grants_until text null — —
used_at text null — —
used_by text null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

ledgers

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
kind text not null 'bank' —
default_parser text null — —
currency text null — —
opening_minor integer not null 0 —
opening_on text null — —
sort_order integer not null 0 —
archived integer not null false —
notebook_id integer null — → notebooks.id
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

locations

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
parent_id integer null — → locations.id
notes text null '' —
sort_order integer not null 0 —
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

mail_failures

Column Type Null Default Notes
id integer not null — primary key, auto
kind text not null — —
to_email text not null — —
subject text not null — —
error text not null — —
attempts integer not null 1 —
body_text text null — —
body_html text null — —
created_at text not null (CURRENT_TIMESTAMP) —
last_attempt_at text not null (CURRENT_TIMESTAMP) —
resolved_at text null — —

Indexes:

media

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
mime text not null — —
filename text not null '' —
alt text not null '' —
notes text not null '' —
byte_size integer not null — —
seconds integer null — —
bytes blob not null — —
sha256 text not null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

Checks — enforced by the database, not only by the service layer:

media_tags

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
media_id integer not null — → media.id
tag_id integer not null — → tags.id

Indexes:

model_provider_keys

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
provider text not null — —
key text not null — —
prefix text not null — —
model text null — —
base_url text null — —
created_at text not null — —
updated_at text not null — —

Indexes:

newsletter_issues

Column Type Null Default Notes
id integer not null — primary key, auto
version text not null — —
subject text not null — —
sent integer not null 0 —
failed integer not null 0 —
sent_at text not null (CURRENT_TIMESTAMP) —

Indexes:

notebook_favourites

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
notebook_id integer not null — → notebooks.id
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

notebooks

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
title text not null — —
folder text not null '' —
description text null '' —
picture_id integer null — → media.id
default_tags text not null '' —
category_id integer null — → categories.id
shared_with_family integer not null false —
modules text null — —
closed_at text null — —
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

oauth_clients

Column Type Null Default Notes
id integer not null — primary key, auto
client_id text not null — —
name text not null — —
redirect_uris text not null — —
uri text null — —
created_at text not null — —
updated_at text not null — —

Indexes:

oauth_codes

Column Type Null Default Notes
id integer not null — primary key, auto
code_hash text not null — —
client_id text not null — —
user_id text not null — → user.id
scopes text not null '' —
code_challenge text not null — —
redirect_uri text not null — —
resource text null — —
expires_at text not null — —
used_at text null — —
created_at text not null — —

Indexes:

people

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
relationship text not null 'other' —
birthday text null — —
remind_on_birthday integer not null true —
phone text null — —
email text null — —
notes text null '' —
picture_id integer null — → media.id
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

phone_widgets

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
token_id integer not null — → api_tokens.id
notebook_id integer not null — → notebooks.id
section text not null — —
status text not null — —
sort_by text not null — —
direction text not null — —
tag text null — —
created_at text not null — —
updated_at text not null — —

Indexes:

plan_members

Column Type Null Default Notes
id integer not null — primary key, auto
owner_id text not null — → user.id
member_id text not null — → user.id
accepted_at text null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

planning_schemes

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

plugin_manifests

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
source text not null — —
name text not null — —
description text null '' —
homepage text null '' —
meta_keys text not null '[]' —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

price_points

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
item_id integer not null — → inventory_items.id
price_cents integer not null — —
for_date text not null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

push_subscriptions

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
endpoint text not null — —
p256dh text not null — —
auth text not null — —
label text null — —
failures integer not null 0 —
last_push_at text null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

quotes

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
text text not null — —
author text null '' —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

recipe_images

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
recipe_id integer not null — → recipes.id
media_id integer not null — → media.id
position integer not null 0 —
is_main integer not null false —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

recipe_items

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
recipe_id integer not null — → recipes.id
item_id integer not null — → inventory_items.id
quantity real null — —
unit text null '' —
note text null '' —
sort_order integer not null 0 —

Indexes:

Checks — enforced by the database, not only by the service layer:

recipes

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
title text not null — —
method text not null '' —
notes text null '' —
servings integer null — —
minutes integer null — —
source text null '' —
last_cooked_at text null — —
archived_at text null — —
notebook_id integer null — → notebooks.id
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

Checks — enforced by the database, not only by the service layer:

recurring_task_tags

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
task_id integer not null — → recurring_tasks.id
tag_id integer not null — → tags.id
tagged_at text null — —

Indexes:

recurring_tasks

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
weekday integer not null — —
recurrence text not null 'weekly' —
start_time text not null — —
duration_minutes integer not null 60 —
mode text not null — —
category_id integer null — → categories.id
activity_id integer null — → activities.id
label text null '' —
active integer not null true —
remind_lead_minutes integer null — —
urgency integer null — —
interest integer null — —
ease integer null — —
attributes text not null '{}' —
notebook_id integer null — → notebooks.id
recipe_id integer null — → recipes.id
workout_id integer null — → workouts.id
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

Checks — enforced by the database, not only by the service layer:

reminder_sounds

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
kind text not null — —
ringtone_id integer null — → ringtones.id
audible integer not null false —
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

reminders

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
subject_kind text not null 'free' —
subject_id integer null — —
remind_at text not null — —
message text not null — —
delivered_at text null — —
pushed_at text null — —
dismissed_at text null — —
audible integer null — —
ringtone_id integer null — → ringtones.id
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

request_replays

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
request_id text not null — —
tool text not null — —
fingerprint text not null — —
answer text not null — —
created_at text not null — —

Indexes:

ringtones

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
mime text not null — —
bytes integer not null — —
data blob not null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

scheme_slots

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
scheme_id integer not null — → planning_schemes.id
weekday integer not null — —
start_time text not null — —
duration_minutes integer not null 60 —
mode text not null — —
category_id integer null — → categories.id
activity_id integer null — → activities.id
label text null '' —
active integer not null true —

Indexes:

sent_notifications

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
title text not null — —
body text not null '' —
url text null — —
kind text not null '' —
read_at text null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

session

Column Type Null Default Notes
id text not null — primary key
expires_at integer not null — —
token text not null — —
created_at integer not null (cast(unixepoch('subsecond') * 1000 as integer)) —
updated_at integer not null — —
ip_address text null — —
user_agent text null — —
user_id text not null — → user.id
impersonated_by text null — —

Indexes:

subscribers

Column Type Null Default Notes
id integer not null — primary key, auto
email text not null — —
token text not null — —
source text not null 'site' —
confirmed_at text null — —
unsubscribed_at text null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

subscriptions

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
plan text not null 'none' —
status text not null 'trialing' —
provider text not null 'none' —
provider_customer_id text null — —
provider_subscription_id text null — —
current_period_end text null — —
trial_ends_at text null — —
trial_notice_sent_at text null — —
cancel_at text null — —
portal_url text null — —
seats integer not null 1 —
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

suppressed_slots

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
date text not null — —
slot_id integer not null — → recurring_tasks.id
moved_to_id integer null — → exceptional_tasks.id

Indexes:

tags

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
color text null — —
description text not null '' —

Indexes:

task_records

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
slot_id integer null — → recurring_tasks.id
exceptional_slot_id integer null — → exceptional_tasks.id
scheduled_at text not null — —
status text not null 'todo' —
completed_at text null — —
notes text null '' —
resolved_activity_id integer null — → activities.id
duration_override integer null — —
label_override text null — —
urgency_override integer null — —
interest_override integer null — —
ease_override integer null — —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

Checks — enforced by the database, not only by the service layer:

todo_tags

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
todo_id integer not null — → todo_tasks.id
tag_id integer not null — → tags.id
tagged_at text null — —

Indexes:

todo_tasks

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
title text not null — —
notes text null '' —
completed integer not null false —
completed_at text null — —
category_id integer null — → categories.id
notebook_id integer null — → notebooks.id
notebook_seq integer null — —
scheduled_date text null — —
delegated_slot_id integer null — → exceptional_tasks.id
status text not null 'todo' —
archived_at text null — —
sort_order integer not null 0 —
urgency integer null — —
interest integer null — —
ease integer null — —
attributes text not null '{}' —
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

Checks — enforced by the database, not only by the service layer:

user

Column Type Null Default Notes
id text not null — primary key
name text not null — —
email text not null — —
email_verified integer not null false —
image text null — —
role text not null 'member' —
banned integer null false —
ban_reason text null — —
ban_expires integer null — —
last_active_at integer null — —
created_at integer not null (cast(unixepoch('subsecond') * 1000 as integer)) —
updated_at integer not null (cast(unixepoch('subsecond') * 1000 as integer)) —

Indexes:

user_settings

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
key text not null — —
value text not null — —

Indexes:

verification

Column Type Null Default Notes
id text not null — primary key
identifier text not null — —
value text not null — —
expires_at integer not null — —
created_at integer not null (cast(unixepoch('subsecond') * 1000 as integer)) —
updated_at integer not null (cast(unixepoch('subsecond') * 1000 as integer)) —

Indexes:

webhook_subscriptions

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
url text not null — —
events text not null — —
secret text not null — —
last_delivery_at text null — —
last_status integer null — —
fail_count integer not null 0 —
disabled_at text null — —
created_at text not null — —
updated_at text not null — —

Indexes:

weekly_reviews

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
week_start text not null — —
position integer not null — —
content text not null — —
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

workout_categories

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
name text not null — —
sort_order integer not null 0 —
created_at text not null (CURRENT_TIMESTAMP) —

Indexes:

workout_measures

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
session_id integer not null — → workout_sessions.id
activity text not null — —
amount real null — —
unit text not null '' —
sort_order integer not null 0 —

Indexes:

workout_plan_measures

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
workout_id integer not null — → workouts.id
activity text not null — —
unit text not null '' —
sort_order integer not null 0 —

Indexes:

workout_sessions

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
workout_id integer not null — → workouts.id
done_on text not null — —
notes text not null '' —
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

workouts

Column Type Null Default Notes
id integer not null — primary key, auto
user_id text not null — → user.id
title text not null — —
category_id integer null — → workout_categories.id
plan text not null '' —
notes text null '' —
minutes integer null — —
last_done_at text null — —
archived_at text null — —
notebook_id integer null — → notebooks.id
created_at text not null (CURRENT_TIMESTAMP) —
updated_at text not null (CURRENT_TIMESTAMP) —

Indexes:

Checks — enforced by the database, not only by the service layer: