Skip to content

Some tables are missing created_at and/or updated_at columns #747

@brendanlong

Description

@brendanlong

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions