Made Open

Complete Data Model — Made Open Platform

All database tables across 53 migrations. Tables are grouped by migration and listed with key columns, purpose, and the service that primarily uses them.

Count: 177 unique tables across 53 migrations (180 CREATE TABLE statements; organizations, intentions, and context_snapshots are each declared twice across different migrations with IF NOT EXISTS). All tables have owner_id + RLS unless noted.


Core Entities (Migration: 00001_initial_schema.sql)

Extensions enabled: uuid-ossp, pgcrypto, vector (pgvector)

TableKey ColumnsPurposeUsed By
personsid, owner_id, name, emails (jsonb), phones (jsonb), addresses (jsonb), tags (jsonb), birthday, notes, avatar_url, sources (jsonb)Contact recordsDataService
organizationsid, owner_id, name, domain, industry, address (jsonb), phone, website, sources (jsonb)Company/org recordsDataService
channelsid, owner_id, type (phone/email/sms/chat), provider, provider_channel_id, display_name, is_active, config (jsonb)Communication channel registrationsChannelService
conversationsid, owner_id, channel_id, participants (jsonb), subject, status (active/archived/closed), tags (jsonb), last_message_atConversation threadsDataService
messagesid, owner_id, conversation_id, channel_id, sender_id, sender_type, direction (inbound/outbound), content_type, body, metadata (jsonb)Individual messages in conversationsDataService
attachmentsid, owner_id, message_id, filename, mime_type, size_bytes, storage_pathFile attachments on messagesDataService
eventsid, owner_id, title, description, start_at, end_at, all_day, recurrence (jsonb), location, attendees (jsonb), source, source_id, reminders (jsonb)Calendar eventsDataService
locationsid, owner_id, name, label (home/work/gym/custom), latitude, longitude, radius_m, addressNamed location definitionsDataService
devicesid, owner_id, name, platform (android/ios/windows/macos/linux), device_token, capabilities (jsonb), last_seen_at, is_activeRegistered user devicesDataService
location_historyid, owner_id, device_id, latitude, longitude, accuracy_m, altitude_m, speed_mps, heading, timestamp, location_idGPS location history streamDataService
tasksid, owner_id, title, description, status (pending/in_progress/done/cancelled), priority (low/medium/high/urgent), due_at, completed_at, tags (jsonb), assigned_toTask/todo itemsDataService
documentsid, owner_id, title, content, mime_type, storage_path, size_bytes, tags (jsonb), source, source_id, summaryDocument storeDataService
rulesid, owner_id, name, description, conditions (jsonb), actions (jsonb), is_active, priority, last_triggered_at, trigger_countAutomation rules (DSL)RulesService
job_recordsid, owner_id, queue (realtime/interactive/background), event_type, payload (jsonb), status, attempts, max_attempts, error, started_at, completed_atJob execution logJob Queue
audit_logid, owner_id, actor_id, actor_type, action, resource_type, resource_id, details (jsonb), ip_address, user_agent, correlation_id, created_atAppend-only audit trail (no UPDATE/DELETE)AuditService
embeddingsid, owner_id, entity_type, entity_id, embedding (vector(1536)), model, created_atpgvector embeddings for semantic searchEmbeddingPipelineService

Intentions (Migration: 00002_phase2_intentions.sql)

TableKey ColumnsPurposeUsed By
intentionsid, owner_id, type, title, description, conditions (jsonb), actions (jsonb), status, priority, schedule (jsonb), context (jsonb), expires_at, resolved_atFuture-plane scheduled intentionsIntentionsService
presence_snapshotsid, owner_id, location_id, device_id, detected_at, confidence, is_currentLocation presence snapshots for rulesRulesService

AI (Migration: 00003_phase3_ai.sql)

TableKey ColumnsPurposeUsed By
agent_conversationsid, owner_id, title, model, messages (jsonb), context (jsonb), token_count, statusAI agent chat historyAgentService
workflow_definitionsid, owner_id, name, description, steps (jsonb), triggers (jsonb), is_activeMulti-step workflow definitionsWorkflowService
workflow_runsid, definition_id, owner_id, status, current_step, step_results (jsonb), context (jsonb), started_at, completed_at, errorWorkflow execution runsWorkflowService
llm_usageid, owner_id, model, provider, prompt_tokens, completion_tokens, total_tokens, cost_usd, latency_ms, request_typeLLM usage tracking and cost accountingAgentService

LLM Routing Rules (Migration: 00037_llm_routing_rules.sql)

TableKey ColumnsPurposeUsed By
llm_routing_rulesid, owner_id, name, priority, conditions (jsonb), model, provider, max_tokens, temperature, is_activePer-user LLM model routing rulesAgentService

Federation (Migration: 00004_phase4_federation.sql)

TableKey ColumnsPurposeUsed By
didsid, owner_id, method, did_document (jsonb), private_key_encrypted, public_key, is_primaryDecentralised IdentifiersDIDService
verifiable_credentialsid, owner_id, issuer_did, subject_did, type (jsonb), credential_subject (jsonb), proof (jsonb), status (active/revoked/expired), issued_at, expires_atW3C Verifiable CredentialsVCService
federated_actorsid, owner_id, actor_uri, inbox_url, outbox_url, public_key_pem, display_name, is_localActivityPub actor profilesActivityPubService
followsid, owner_id, follower_uri, following_uri, status (pending/accepted/rejected), followed_atActivityPub follow relationshipsActivityPubService
activitiesid, owner_id, type, actor_uri, object (jsonb), target (jsonb), published_at, is_localActivityPub activity streamActivityPubService
didcomm_messagesid, owner_id, from_did, to_did, type, body (jsonb), encrypted_body, thread_id, status (sent/delivered/read), sent_atDIDComm v2 encrypted messagesDIDCommService

Marketplace (Migration: 00005_phase5_marketplace.sql)

TableKey ColumnsPurposeUsed By
listingsid, owner_id, title, description, category, price (jsonb), status (draft/active/sold/expired), tags (jsonb), images (jsonb), location_id, visibilityMarketplace item listingsMarketplaceService
data_productsid, owner_id, listing_id, data_type, schema (jsonb), sample_data (jsonb), privacy_level, access_policy (jsonb), row_countPrivacy-preserving data productsDataProductBuilder
marketplace_transactionsid, buyer_id, seller_id, listing_id, amount (jsonb), status (pending/completed/refunded/disputed), payment_method, escrow_id, completed_atPurchase transactionsMarketplaceService
declarationsid, owner_id, type (offer/need), title, description, category, requirements (jsonb), availability (jsonb), status, location_idOffer/Need declarationsResourceCoordinationService
exchangesid, offer_id, need_id, offerer_id, requester_id, status (proposed/accepted/in_progress/completed/cancelled), terms (jsonb), started_at, completed_atResource exchange workflowsResourceCoordinationService
trust_relationshipsid, owner_id, subject_id, trust_level, context, evidence (jsonb), established_at, expires_atExplicit trust declarationsReputationService
reputation_scoresid, owner_id, domain, score, confidence, attestation_count, decay_factor, last_updatedMulti-domain reputation scoresReputationService

Governance (Migration: 00006_phase6_governance.sql)

TableKey ColumnsPurposeUsed By
daosid, owner_id, name, description, governance_model (direct/representative/liquid), membership_policy, treasury (jsonb), charter (jsonb)DAO definitionsDAOService
dao_membersid, dao_id, user_id, role (member/delegate/admin), voting_power, delegated_to, joined_atDAO membershipDAOService
proposalsid, dao_id, author_id, title, description, type (policy/budget/membership/amendment), status (draft/discussion/voting/passed/rejected/executed), voting_config (jsonb), discussion_ends_at, voting_ends_atGovernance proposalsProposalService
votesid, proposal_id, voter_id, choice, weight, reasoning, delegated_from, cast_atIndividual votes on proposalsVotingService
time_creditsid, owner_id, balance, earned_total, spent_total, currency (hours)Time bank credit balancesTimeBankService
time_credit_transactionsid, from_id, to_id, amount, description, type (earn/spend/transfer), reference_type, reference_id, created_atTime credit transfersTimeBankService
disputesid, owner_id, respondent_id, type, title, description, evidence (jsonb), status (filed/investigating/mediation/arbitration/resolved/dismissed), resolution, resolved_atDispute casesDisputeService
moderation_actionsid, owner_id, moderator_id, target_type, target_id, action (warn/suspend/remove/restrict), reason, expires_atModeration action logModerationService

Web3 (Migration: 00007_phase8_web3.sql)

TableKey ColumnsPurposeUsed By
wallet_connectionsid, owner_id, chain, address, public_key, is_primary, connected_atCrypto wallet connectionsWalletService
time_credit_bridge_requestsid, owner_id, amount, direction (on_chain/off_chain), chain, tx_hash, status (pending/confirming/completed/failed)Bridge credits to/from blockchainTimeCreditBridgeService

Federated Marketplace + Calling (Migrations: 00008, 00009, 00010)

TableKey ColumnsPurposeUsed By
federated_listing_cacheid, source_hub_url, original_listing_id, title, description, category, price (jsonb), seller_actor_uri, cached_at, expires_atCached listings from federated hubsFederatedMarketplaceService
hub_subscriptionsid, local_hub_url, remote_hub_url, status (active/paused/expired), categories (jsonb), subscribed_atHub-to-hub marketplace subscriptionsFederatedMarketplaceService
call_sessionsid, owner_id, call_sid, direction, from_number, to_number, status, duration_s, recording_url, started_at, ended_atTwilio call session recordsTwilioCallingService
agent_memoryid, owner_id, conversation_id, role, content, embedding (vector), importance, accessed_at, expires_atAgent long-term memory entriesAgentMemoryService
agent_tool_callsid, conversation_id, tool_name, input (jsonb), output (jsonb), latency_ms, status, called_atAgent tool execution logToolRegistry

Privacy + Notifications (Migrations: 00011, 00012)

TableKey ColumnsPurposeUsed By
retention_policiesid, owner_id, entity_type, max_age_days, action (delete/anonymize/archive), is_activePer-entity data retention rulesPrivacyEngine
consent_recordsid, owner_id, purpose, scope, granted, granted_at, expires_at, revoked_atGDPR-style consent trackingPrivacyEngine
pii_scan_logid, owner_id, entity_type, entity_id, fields_found (jsonb), risk_level, scanned_atPII detection scan resultsPrivacyEngine
notification_subscriptionsid, owner_id, device_id, endpoint, keys (jsonb), is_active, subscribed_atPush notification subscriptionsNotificationService
outbound_webhooksid, owner_id, url, events (jsonb), secret, is_active, created_atRegistered webhook endpointsOutboundWebhookService
webhook_delivery_logid, webhook_id, event_type, payload (jsonb), status_code, response_body, attempts, delivered_atWebhook delivery attemptsOutboundWebhookService

Presence + Audit (Migrations: 00013, 00014)

TableKey ColumnsPurposeUsed By
user_presenceid, owner_id, status (online/away/busy/offline), last_seen_at, device_id, metadata (jsonb)Real-time user presencePresenceService
collaboration_sessionsid, owner_id, type, resource_type, resource_id, participants (jsonb), started_at, ended_atReal-time collaboration sessionsPresenceService
collaboration_cursorsid, session_id, user_id, position (jsonb), color, updated_atCursor positions in collaborative editingPresenceService
compliance_reportsid, owner_id, type, period_start, period_end, data (jsonb), status, generated_atCompliance report recordsAuditService
audit_alert_rulesid, owner_id, name, conditions (jsonb), notify_channels (jsonb), is_activeAlert rules on audit patternsAuditService

Plugins + Documents (Migrations: 00015, 00016)

TableKey ColumnsPurposeUsed By
plugin_registryid, name, version, description, author, category, manifest (jsonb), icon_url, downloads, is_verified, published_atPlugin marketplace catalogPluginRegistryService
user_pluginsid, owner_id, plugin_id, is_enabled, config (jsonb), installed_atUser-installed pluginsPluginRegistryService
plugin_ratingsid, plugin_id, user_id, rating, review, created_atPlugin ratings and reviewsPluginRegistryService
document_jobsid, owner_id, document_id, type (analyse/classify/extract/summarise), status, result (jsonb), error, created_at, completed_atDocument processing job queueDocumentIntelligenceService
document_chunksid, document_id, owner_id, content, chunk_index, embedding (vector), metadata (jsonb)Document chunks for RAGDocumentIntelligenceService
document_entitiesid, document_id, owner_id, entity_type, entity_value, confidence, position (jsonb)Entities extracted from documentsDocumentIntelligenceService

Rules + Scheduled Jobs (Migrations: 00017, 00018)

TableKey ColumnsPurposeUsed By
rule_templatesid, name, description, category, conditions_template (jsonb), actions_template (jsonb), variables (jsonb), popularityPre-built rule templatesRuleTemplateService
rule_execution_logid, rule_id, owner_id, event_type, matched, actions_fired (jsonb), latency_ms, executed_atRule execution audit trailRuleAnalyticsService

Migration 00018 sets up pg_cron scheduled jobs (no new tables — uses cron.schedule() for retention, audit alerts, presence sync, weekly digest, document job expiry).

Rate Limiting (Migration: 00019_phase16_rate_limits.sql)

TableKey ColumnsPurposeUsed By
rate_limit_eventsid, owner_id, endpoint, window_start, request_count, limited_atRate limit hit trackingRateLimiterService
circuit_breaker_snapshotsid, service_name, state (closed/open/half_open), failure_count, last_failure_at, snapshot_atCircuit breaker state persistenceCircuitBreakerService

Event Store (Migration: 00020_phase17_event_store.sql)

TableKey ColumnsPurposeUsed By
event_storeid, stream_id, event_type, data (jsonb), metadata (jsonb), version, created_atImmutable event store for event sourcingEventStoreService
event_snapshotsid, stream_id, data (jsonb), version, created_atPeriodic snapshots for replay optimizationEventStoreService

Streaming (Migration: 00021_phase18_streaming.sql)

TableKey ColumnsPurposeUsed By
activity_feedid, owner_id, actor_id, action, target_type, target_id, data (jsonb), read, created_atUser activity feed itemsActivityFeedService

Multi-Tenancy (Migration: 00022_phase19_orgs.sql)

TableKey ColumnsPurposeUsed By
organizations (extended)id, name, slug, owner_id, plan, settings (jsonb), created_atOrg/tenant accounts (extends core schema)OrgService
org_membershipsid, org_id, user_id, role (owner/admin/member), joined_atOrganisation membershipOrgService
org_invitesid, org_id, email, role, token, status (pending/accepted/expired), invited_by, created_at, expires_atOrg invitation tokensOrgService
usage_recordsid, org_id, metric, value, recorded_atPer-org usage meteringUsageService
billing_eventsid, org_id, type, amount, currency, metadata (jsonb), created_atBilling event logUsageService

Developer API (Migration: 00023_phase20_developer.sql)

TableKey ColumnsPurposeUsed By
oauth_appsid, owner_id, name, client_id, client_secret_hash, redirect_uris (jsonb), scopes (jsonb), is_activeRegistered OAuth2 applicationsOAuthService
oauth_auth_codesid, app_id, user_id, code, redirect_uri, scopes (jsonb), expires_atOAuth2 authorization codesOAuthService
oauth_tokensid, app_id, user_id, access_token_hash, refresh_token_hash, scopes (jsonb), expires_atOAuth2 access/refresh tokensOAuthService
api_keysid, owner_id, name, key_hash, scopes (jsonb), last_used_at, expires_at, is_activeDeveloper API keysOAuthService

Advanced Search (Migration: 00024_phase21_search.sql)

TableKey ColumnsPurposeUsed By
saved_searchesid, owner_id, name, query, filters (jsonb), sort_by, notify_on_new, last_run_atPersistent saved search definitionsSavedSearchService
recommendationsid, owner_id, source_type, source_id, target_type, target_id, score, reason, seen, created_atAI-generated recommendationsRecommendationEngine

Data Portability (Migration: 00025_phase22_data_portability.sql)

TableKey ColumnsPurposeUsed By
export_jobsid, owner_id, format (json/csv/vcard/ical), entity_types (jsonb), filters (jsonb), status, file_path, file_size, started_at, completed_atData export job recordsExportService
import_jobsid, owner_id, format, file_path, status, stats (jsonb), errors (jsonb), started_at, completed_atData import job recordsImportService

Preferences (Migration: 00026_phase23_preferences.sql)

TableKey ColumnsPurposeUsed By
user_preferencesid, owner_id, theme, locale, timezone, notification_settings (jsonb), privacy_settings (jsonb), dashboard_layout (jsonb)User settings and preferencesUserPreferencesService

Monitoring + Email (Migration: 00027_phase26_monitoring.sql)

TableKey ColumnsPurposeUsed By
tracked_errorsid, owner_id, error_type, message, stack_trace, context (jsonb), fingerprint, occurrences, first_seen, last_seen, status (open/acknowledged/resolved)Error aggregationErrorTrackingService
email_queueid, owner_id, to_address, subject, body_html, body_text, status (queued/sending/sent/failed), attempts, sent_atTransactional email queueEmailService

Billing + Feature Flags (Migration: 00028_phase27_billing.sql)

TableKey ColumnsPurposeUsed By
stripe_customersid, owner_id, stripe_customer_id, plan, status (active/past_due/cancelled), current_period_end, created_atStripe customer recordsBillingService
checkout_sessionsid, owner_id, stripe_session_id, plan, status, amount, currency, created_at, completed_atStripe checkout sessionsBillingService
feature_flagsid, name, description, is_enabled, targeting_rules (jsonb), rollout_percentage, created_atFeature flag definitionsFeatureFlagService

Security + Analytics (Migration: 00029_phase28_security.sql)

TableKey ColumnsPurposeUsed By
user_sessionsid, owner_id, token_hash, ip_address, user_agent, device_id, expires_at, created_at, revoked_atUser session managementSessionService
analytics_eventsid, owner_id, event_name, properties (jsonb), session_id, device_type, created_atUser behaviour analytics eventsAnalyticsService

Data Lineage (Migration: 00030_phase29_lineage.sql)

TableKey ColumnsPurposeUsed By
entity_lineageid, entity_type, entity_id, field_name, source, source_id, confidence, recorded_atField-level data provenanceLineageService
merge_candidatesid, owner_id, entity_type, entity_a_id, entity_b_id, similarity_score, status (pending/merged/rejected), detected_atDuplicate entity detectionEntityMergeService
conflict_resolution_rulesid, owner_id, entity_type, field_name, strategy (newest/highest_confidence/manual/source_priority), priority_sources (jsonb)Merge conflict resolution rulesEntityMergeService

Credential Wallet (Migration: 00031_credential_wallet.sql)

TableKey ColumnsPurposeUsed By
user_credentialsid, owner_id, service_name, credential_type, encrypted_data, metadata (jsonb), is_active, created_atEncrypted credential storage (Vault)Plugin Manager / Credential Wallet API

Tools (Migration: 00032_tools.sql)

TableKey ColumnsPurposeUsed By
tool_jobsid, owner_id, tool_name, input (jsonb), output (jsonb), status (pending/running/completed/failed), error, priority, created_at, started_at, completed_atTool execution job queueToolsService
fontsid, name, family, style, weight, format, file_path, created_atFont registry for document generationToolsService

Audio Intelligence (Migrations: 00033, 00034)

TableKey ColumnsPurposeUsed By
audio_sessionsid, owner_id, device_id, started_at, ended_at, duration_s, status, source, storage_path, file_sizeAudio recording session recordsAudioETLService
transcriptsid, owner_id, audio_session_id, content, language, confidence, model, segments (jsonb), started_at, completed_atAudio transcriptionsAudioETLService
voice_commandsid, owner_id, transcript_id, command_text, intent, confidence, parameters (jsonb), status (detected/executing/completed/failed), result (jsonb)Interpreted voice commandsVoiceCommandService
extracted_intelligenceid, owner_id, transcript_id, type (action_item/decision/question/commitment/topic), content, confidence, entity_refs (jsonb), context (jsonb)Intelligence extracted from audioAudioETLService
daily_briefsid, owner_id, date, summary, key_items (jsonb), audio_sessions_count, total_duration_s, generated_atDaily audio intelligence summariesAudioETLService
context_snapshotsid, owner_id, device_id, timestamp, active_app, window_title, url, location (jsonb), calendar_event_idDevice context at time of audio captureAudioETLService
transcript_chunksid, owner_id, transcript_id, content, chunk_index, start_time_s, end_time_s, speaker_id, embedding (vector), importance_scoreChunked transcript segments for RAGAudioETLService
passive_intentsid, owner_id, transcript_chunk_id, intent_type (reminder/todo/follow_up/meeting/contact), description, confidence, extracted_entities (jsonb), status (detected/confirmed/dismissed/actioned), action_taken (jsonb)Passive intent detection from conversationVoiceCommandService

Device Commands (Migration: 00035_device_commands.sql)

TableKey ColumnsPurposeUsed By
device_commandsid, owner_id, device_id, module (filesystem/process/clipboard/display/power/network/registry/notifications/input/shell/agent), action, params (jsonb), status (pending/sent/running/completed/failed/timeout), result (jsonb), source, priority, progress (jsonb)OS-level device command queueDeviceCommandService

Migration 00036 extends device_commands with agent module and agent-worker source for AI agent sessions.

Unified Scheduler (Migration: 00038_unified_scheduler.sql)

TableKey ColumnsPurposeUsed By
schedulesid, owner_id, name, schedule_type, cron_expression, next_run_at, payload (jsonb), is_activeUnified scheduled job definitionsSchedulerService
schedule_runsid, schedule_id, owner_id, status, started_at, completed_at, errorScheduled job execution historySchedulerService

Wiki (Migration: 00040_wiki.sql)

TableKey ColumnsPurposeUsed By
wiki_pagesid, owner_id, slug, title, body, tags (jsonb), updated_atPersistent compiled wiki pagesWikiService
wiki_linksid, owner_id, from_page_id, to_page_id, link_typeInternal wiki page link graphWikiService

Inventory (Migration: 00041_phase41_inventory.sql)

TableKey ColumnsPurposeUsed By
inventory_itemsid, owner_id, name, category, space_id, quantity, metadata (jsonb)Inventory item recordsInventoryService
inventory_spacesid, owner_id, name, parent_space_id, metadata (jsonb)Hierarchical storage locationsInventoryService
inventory_maintenanceid, owner_id, item_id, maintenance_type, performed_at, next_due_at, notesItem maintenance historyInventoryService
inventory_eventsid, owner_id, item_id, event_type, occurred_at, metadata (jsonb)Inventory lifecycle event logInventoryService

Migration 00048 (provider_abstraction.sql) adds no new tables — it introduces a provider abstraction layer over existing tables.


Unified Communications Inbox (Migration: 00042_deep_comms.sql)

TableKey ColumnsPurposeUsed By
inbox_itemsid, owner_id, type (call/sms/email/video/calendar_event/voicemail), conversation_id, contact_id, channel_type (twilio_voice/twilio_sms/ms_graph_email/twilio_video), direction, subject, preview, timestamp, read, starred, archived, source_table, source_idUnified inbox — materialized view of all communication events across channelsDeepCommsService

Migration also extends conversations with thread_type (default: single_channel) and related_conversation_ids (uuid[]) columns.

Indexes: owner+timestamp (main inbox query), owner+read+timestamp (unread filter), owner+contact+timestamp (contact timeline)

Deep Voice / Business Phone System (Migration: 00043_deep_voice.sql)

TableKey ColumnsPurposeUsed By
phone_linesid, owner_id, phone_number, twilio_sid, label, settings (jsonb), is_defaultMulti-line phone number managementDeepVoiceService
voicemailsid, owner_id, call_session_id, phone_line_id, from_number, contact_id, recording_url, recording_sid, transcription, duration_seconds, listenedVoicemail inbox with transcriptionDeepVoiceService
call_recordingsid, owner_id, call_session_id, recording_sid, url, duration_secondsCall recording storage referencesDeepVoiceService
call_transcriptsid, owner_id, call_session_id, segments (jsonb), full_text, provider (default: whisper)Call transcriptions with speaker segmentsDeepVoiceService
call_analysesid, owner_id, call_session_id, transcript_id, summary, action_items (jsonb), sentiment (positive/neutral/negative), key_topics (text[]), entities (jsonb)AI analysis of call transcriptsDeepVoiceService
ivr_flowsid, owner_id, phone_line_id, name, flow_definition (jsonb), is_activeIVR flow definitions per phone lineDeepVoiceService

Indexes: phone_lines: owner, unique owner+number; voicemails: owner+created, owner+listened+created; call_recordings: owner, session; call_transcripts: session, owner; call_analyses: session, owner+created; ivr_flows: owner, line+active

Full Email Client (Migration: 00044_email_client.sql)

TableKey ColumnsPurposeUsed By
email_foldersid, owner_id, name, ms_graph_id, parent_folder_id, unread_count, total_count, folder_type (inbox/sent/drafts/trash/archive/junk/custom)Email folder hierarchy synced from MS GraphEmailClientService
email_threadsid, owner_id, ms_graph_conversation_id, subject, last_message_at, folder_id, participants (jsonb), snippet, unread, starred, message_count, has_attachmentsEmail conversation threadsEmailClientService
email_signaturesid, owner_id, name, body_html, is_defaultUser email signaturesEmailClientService

Migration also extends messages with email-specific columns: email_thread_id, folder_id, cc (jsonb), bcc (jsonb), reply_to, has_attachments, is_draft, subject, from_address, to_addresses (jsonb).

Indexes: email_folders: owner, owner+type, owner+ms_graph_id, parent; email_threads: owner+folder+last_message, owner+unread+last_message, owner+starred+last_message, owner+ms_graph_conv; messages: email_thread+timestamp, owner+folder+timestamp, owner+is_draft (partial)

Video Meetings (Migration: 00045_meetings.sql)

TableKey ColumnsPurposeUsed By
meetingsid, owner_id, title, room_name (unique), scheduled_start, scheduled_end, status (scheduled/active/ended), settings (jsonb), calendar_event_id, invite_linkFull meeting lifecycle — scheduled through endedMeetingService
meeting_participantsid, meeting_id, contact_id, email, role (host/participant), status (invited/joined/left), joined_at, left_atMeeting participant roster and attendanceMeetingService
meeting_recordingsid, meeting_id, recording_sid, url, duration_seconds, composition_status (enqueued/processing/completed/failed)Twilio Video recording compositionMeetingService
meeting_analysesid, meeting_id, transcript_id, summary, action_items (jsonb), key_decisions (jsonb), sentiment (positive/neutral/negative), key_topics (text[]), entities (jsonb)AI analysis of meeting recordingsMeetingService

RLS for meeting_participants, meeting_recordings, and meeting_analyses uses a subquery to check meetings.owner_id = auth.uid() rather than a direct owner_id column.

Indexes: meetings: owner+status, owner+scheduled, room_name; meeting_participants: meeting, contact; meeting_recordings: meeting; meeting_analyses: meeting

Contact Timeline (Migration: 00046_contact_timeline.sql)

TableKey ColumnsPurposeUsed By
contact_notesid, owner_id, contact_id, bodyFree-form annotations on contact recordsContactTimelineService
contact_mergesid, owner_id, primary_id, merged_id, merged_at, undone_at; UNIQUE (primary_id, merged_id)Contact deduplication merge history with undo supportContactTimelineService

Indexes: contact_notes: owner+contact+created; contact_merges: owner, primary_id, merged_id

Device Push Tokens (Migration: 00047_device_push_tokens.sql)

TableKey ColumnsPurposeUsed By
device_push_tokensid, owner_id, device_id, fcm_token, platform (android/ios/web), device_name, is_activeFCM push notification tokens for mobile/web devicesNotificationService / PushService

Indexes: unique owner+device_id, owner+is_active, fcm_token

Unified Life Architecture — Foundation (Migration: 00049_unified_life_foundation.sql)

TableKey ColumnsPurposeUsed By
entity_registryid, owner_id, entity_type, entity_id, uri (unique), display_name, metadata (jsonb)Stable URIs for every entity across all domainsEntityRegistryService
entity_relationshipsid, owner_id, from_uri, to_uri, relationship_type, strength, metadata (jsonb), started_at, ended_atFirst-class relationships between any two entitiesRelationshipService
observationsid, owner_id, domain, event_type, entity_uri, occurred_at, location_id, source, payload (jsonb), tags (jsonb)Universal observation spine — every domain event indexed hereObservationService
observation_linksid, observation_id, linked_entity_uri, link_typeCross-entity links on observationsObservationService
context_stateid, owner_id, dimension, value, confidence, derived_at, expires_atCurrent context per dimension (location, activity, social, etc.)ContextEngineV2
context_historyid, owner_id, dimension, value, confidence, valid_from, valid_toHistorical context dimension valuesContextEngineV2
context_snapshotsid, owner_id, snapshot_at, full_context (jsonb)Point-in-time full context snapshotsContextEngineV2
reaction_logid, owner_id, action_type, actor_uri, resource_uri, authorization_chain (jsonb), context_snapshot_id, occurred_atAppend-only immutable log of all system actionsReactionLogService

Unified Life Architecture — Intentions & PM (Migration: 00050_life_intentions_pm.sql)

TableKey ColumnsPurposeUsed By
intentionsid, owner_id, type (goal/aspiration/commitment/maintenance/consent), title, description, target_metric, target_value, current_value, status, priority, due_at, context_conditions (jsonb)Declarative persistent goals with progress trackingIntentionService
projectsid, owner_id, title, description, status (planning/active/on_hold/completed/cancelled), priority, due_at, parent_project_id, tags (jsonb)Project definitions with hierarchyProjectService
milestonesid, project_id, owner_id, title, due_at, completed_at, statusProject milestonesProjectService
time_entriesid, owner_id, project_id, task_id, started_at, ended_at, duration_seconds, descriptionTime tracking on projects and tasksProjectService
habitsid, owner_id, title, description, frequency (daily/weekly/custom), target_count, reminder_conditions (jsonb), is_activeRecurring behavior definitionsHabitService
habit_logsid, habit_id, owner_id, completed_at, note, streak_countHabit completion log with streak trackingHabitService

Migration also extends tasks with project_id, parent_task_id, estimated_seconds, actual_seconds, subtask_count, completed_subtask_count columns.

Unified Life Architecture — Health, Fitness & Finance (Migration: 00051_life_health_finance.sql)

TableKey ColumnsPurposeUsed By
health_metricsid, owner_id, metric_type (heart_rate/blood_pressure/weight/glucose/temperature/spo2/hrv/steps/calories/custom), value, unit, recorded_at, source, notesHealth metric time seriesHealthService
health_symptomsid, owner_id, symptom, severity (1-10), onset_at, resolved_at, notesSymptom trackingHealthService
fitness_activitiesid, owner_id, activity_type, title, started_at, ended_at, duration_seconds, distance_m, calories, gps_track (jsonb), splits (jsonb), heart_rate_zones (jsonb), notesWorkout activity records with GPS and analyticsFitnessService
sleep_recordsid, owner_id, sleep_start, sleep_end, duration_seconds, quality_score, stages (jsonb), notes, sourceSleep session recordsHealthService
mealsid, owner_id, meal_type (breakfast/lunch/dinner/snack), eaten_at, notes, total_calories, total_protein_g, total_carbs_g, total_fat_gMeal recordsNutritionService
meal_itemsid, meal_id, owner_id, food_name, quantity, unit, calories, protein_g, carbs_g, fat_g, fiber_gIndividual items within a mealNutritionService
water_intakeid, owner_id, amount_ml, recorded_atWater intake logNutritionService
dietary_preferencesid, owner_id, preference_type, value, notesDietary restrictions and preferencesNutritionService
financial_accountsid, owner_id, name, account_type (checking/savings/credit/investment/loan), institution, balance, currency, last_synced_atFinancial account definitionsFinanceService
financial_transactionsid, owner_id, account_id, amount, currency, direction (debit/credit), category, merchant, description, occurred_at, tags (jsonb)Financial transaction recordsFinanceService
budgetsid, owner_id, name, category, amount, currency, period (weekly/monthly/annual), start_date, end_dateBudget definitionsFinanceService
subscriptionsid, owner_id, name, amount, currency, billing_cycle, next_billing_date, category, is_active, notesSubscription trackingFinanceService

Unified Life Architecture — Collections, Journal & Knowledge (Migration: 00052_life_collections_knowledge.sql)

TableKey ColumnsPurposeUsed By
collection_typesid, owner_id, name, icon, color, schema_definition (jsonb), is_systemCollection type definitions with custom field schemasCollectionService
collectionsid, owner_id, collection_type_id, title, description, tags (jsonb), is_publicUser collectionsCollectionService
collection_itemsid, collection_id, owner_id, title, data (jsonb), notes, added_at, sort_orderItems within a collectionCollectionService
journal_entriesid, owner_id, body, mood (1-5), energy (1-5), tags (jsonb), written_at, is_privateJournal entries with mood and energy trackingJournalService
media_consumptionid, owner_id, media_type (book/podcast/movie/tv/article/video/music/game), title, creator, status (want/in_progress/completed/abandoned), progress, rating (1-5), started_at, completed_at, notesMedia consumption trackingMediaService
knowledge_capturesid, owner_id, capture_type (note/bookmark/highlight/quote/annotation), content, source_url, source_title, tags (jsonb), captured_at, embedding (vector)Knowledge capture with semantic indexingKnowledgeService
environment_readingsid, owner_id, location_id, sensor_type (weather/air_quality/noise/light/humidity/temperature/pressure), value, unit, recorded_at, sourceEnvironmental sensor readingsEnvironmentService
home_readingsid, owner_id, device_id, reading_type (power/water/gas/temperature/humidity/motion/door/window), value, unit, recorded_atHome/IoT sensor readingsHomeService
utility_billsid, owner_id, utility_type (electric/gas/water/internet/phone), amount, currency, period_start, period_end, due_date, paid_atUtility bill recordsHomeService
learning_subjectsid, owner_id, title, description, category, target_level, current_level, started_at, target_completion_at, is_activeLearning subject definitionsLearningService
study_sessionsid, owner_id, subject_id, duration_seconds, notes, quality_score, studied_atStudy session recordsLearningService
certificationsid, owner_id, name, issuer, issued_at, expires_at, credential_url, subject_idCertifications and credentialsLearningService
capture_rulesid, owner_id, name, trigger_type (app_focus/url_pattern/schedule/keyword/idle), trigger_config (jsonb), capture_types (jsonb), is_activeComputer activity capture rulesCaptureService
activity_capturesid, owner_id, rule_id, active_app, window_title, url, started_at, ended_at, duration_secondsApplication activity capturesCaptureService
screen_capturesid, owner_id, capture_id, storage_path, thumbnail_path, ocr_text, captured_atScreen capture frames with OCRCaptureService
clipboard_eventsid, owner_id, content_type, content_hash, content_preview, captured_atClipboard event logCaptureService
input_activityid, owner_id, period_start, period_end, keystrokes, mouse_clicks, mouse_distance_px, active_secondsInput activity metricsCaptureService
dependentsid, owner_id, entity_uri, dependent_type (child/pet/elderly_parent/other), name, date_of_birth, notes, metadata (jsonb)Dependent records linked to entity registryDependentService

Migration 00053 performs entity_registry backfill — no new tables. Backfills entity_registry rows for all existing persons, organizations, devices, and collections.


Cross-Cutting Patterns

Row Level Security (RLS)

All user-facing tables have RLS enabled with owner_id policies:

ALTER TABLE <table> ENABLE ROW LEVEL SECURITY;
CREATE POLICY "users own their <table>" ON <table>
  USING (auth.uid() = owner_id)
  WITH CHECK (auth.uid() = owner_id);

Common Columns

Most tables share:

  • id — UUID primary key (gen_random_uuid())
  • owner_id — UUID FK to auth.users(id)
  • created_at / updated_at — timestamptz DEFAULT now()
  • status — text with CHECK constraint for valid states

Audit Log Immutability

The audit_log table has no UPDATE or DELETE policies — append-only by design.

Extensions

  • uuid-ossp — UUID generation
  • pgcrypto — Encryption functions
  • vector (pgvector) — Vector similarity search for embeddings
  • pg_cron — Scheduled database jobs (migration 00018)
  • pgsodium — Supabase Vault encryption (credentials)