Summary
Most tables have both created_at and updated_at, but a few are missing one or both. This came up while fixing the Recently Read feature — user_entries lacks created_at, making it hard to distinguish "row was just created with defaults" from "user actually interacted."
Tables missing created_at
| Table |
Has created_at |
Has updated_at |
Notes |
| user_entries |
No |
Yes |
Most impactful — no way to know when row was created vs when user interacted |
| subscription_feeds |
No |
No |
Junction table, lower priority |
| entry_score_predictions |
No |
No |
Has predicted_at but no creation timestamp |
| blocked_senders |
No |
No |
Has blocked_at but no creation timestamp |
Tables missing only updated_at
These are less concerning since many are immutable or have domain-specific timestamps (expires_at, revoked_at, etc.):
invites — immutable once created
sessions — has last_active_at, revoked_at, expires_at
api_tokens — has last_used_at, revoked_at, expires_at
oauth_accounts — effectively immutable
oauth_authorization_codes — short-lived, has used_at, expires_at
oauth_access_tokens — has revoked_at, last_used_at, expires_at
oauth_refresh_tokens — has revoked_at, expires_at
subscription_tags — junction table
narration_content — has generated_at, error_at
entry_summaries — has generated_at, error_at
ingest_addresses — has deleted_at
Suggested fix
Add missing created_at columns (at minimum to user_entries, entry_score_predictions, and blocked_senders). For existing rows, backfill using the best available approximation (e.g., updated_at or related entry/prediction timestamps).
Note: user_entries.created_at is being added as part of the Recently Read fix (#747 or similar).
Filed by Claude
Summary
Most tables have both
created_atandupdated_at, but a few are missing one or both. This came up while fixing the Recently Read feature —user_entrieslackscreated_at, making it hard to distinguish "row was just created with defaults" from "user actually interacted."Tables missing
created_atcreated_atupdated_atpredicted_atbut no creation timestampblocked_atbut no creation timestampTables missing only
updated_atThese are less concerning since many are immutable or have domain-specific timestamps (
expires_at,revoked_at, etc.):invites— immutable once createdsessions— haslast_active_at,revoked_at,expires_atapi_tokens— haslast_used_at,revoked_at,expires_atoauth_accounts— effectively immutableoauth_authorization_codes— short-lived, hasused_at,expires_atoauth_access_tokens— hasrevoked_at,last_used_at,expires_atoauth_refresh_tokens— hasrevoked_at,expires_atsubscription_tags— junction tablenarration_content— hasgenerated_at,error_atentry_summaries— hasgenerated_at,error_atingest_addresses— hasdeleted_atSuggested fix
Add missing
created_atcolumns (at minimum touser_entries,entry_score_predictions, andblocked_senders). For existing rows, backfill using the best available approximation (e.g.,updated_ator related entry/prediction timestamps).Note:
user_entries.created_atis being added as part of the Recently Read fix (#747 or similar).Filed by Claude