Matrix Synapse

The reference Matrix homeserver. This is the full schema at schema version 72 (the main and state stores together), which is the only complete schema the project publishes; every change after it ships as a delta, so this is the version-72 picture rather than the current one. Synapse declares almost no primary keys and almost no foreign keys: rows are identified by unique indexes and the server keeps them consistent itself.

137 tables · 634 columns · 14 foreign keys · 14 domains  |  21 errors · 28 warnings · 123 notes

Generated from synapse@v1.160.0.sql on 2026-09-05.

Conventions

Conventions are claims. Findings below are where the schema breaks them.

Findings

Errors (21)

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE current_state_delta_stream ADD PRIMARY KEY (...);
F010deleted_pushersprimary-key

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE deleted_pushers ADD PRIMARY KEY (...);
F011device_auth_providersprimary-key

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE device_auth_providers ADD PRIMARY KEY (...);

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE device_federation_inbox ADD PRIMARY KEY (...);

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE device_federation_outbox ADD PRIMARY KEY (...);
F014device_inboxprimary-key

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE device_inbox ADD PRIMARY KEY (...);

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE device_lists_outbound_pokes ADD PRIMARY KEY (...);
F021device_lists_streamprimary-key

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE device_lists_stream ADD PRIMARY KEY (...);

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE e2e_cross_signing_signatures ADD PRIMARY KEY (...);
F031event_authprimary-key

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE event_auth ADD PRIMARY KEY (...);
F032event_auth_chain_linksprimary-key

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE event_auth_chain_links ADD PRIMARY KEY (...);

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE event_push_actions_staging ADD PRIMARY KEY (...);
F050insertion_event_edgesprimary-key

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE insertion_event_edges ADD PRIMARY KEY (...);

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE local_media_repository_url_cache ADD PRIMARY KEY (...);
F061presence_streamprimary-key

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE presence_stream ADD PRIMARY KEY (...);
F063push_rules_streamprimary-key

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE push_rules_stream ADD PRIMARY KEY (...);
F074room_alias_serversprimary-key

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE room_alias_servers ADD PRIMARY KEY (...);
F109state_groups_stateprimary-key

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE state_groups_state ADD PRIMARY KEY (...);

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE stream_ordering_to_exterm ADD PRIMARY KEY (...);
F093user_daily_visitsprimary-key

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE user_daily_visits ADD PRIMARY KEY (...);

No primary key

Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.

Fix Add a natural composite key or a surrogate id.

ALTER TABLE users_pending_deactivation ADD PRIMARY KEY (...);

Warnings (28)

F110access_tokens refresh_token_idfk-index

Foreign key without index

PostgreSQL does not index FK columns automatically. Every DELETE/UPDATE on refresh_tokens must scan access_tokens to check the constraint, and every join from the parent side is a sequential scan. The scan cost grows with the child table forever, so this gets worse on its own. An index is not free. Every write to access_tokens maintains it — insert, update and delete alike — and it takes disk. Weigh that against how often refresh_tokens rows are actually deleted or re-keyed — if the answer is never, the scan never happens and the index only costs.

Fix Add a partial index, scoped to the rows that have a value. refresh_token_id is nullable, so the NULL rows are not indexed at all and the write cost is a fraction of a full index, while the constraint check still uses it.

CREATE INDEX CONCURRENTLY idx_access_tokens_refresh_token_id ON access_tokens(refresh_token_id) WHERE refresh_token_id IS NOT NULL;
F115account_data account_data_typeundocumented-enum

Enum-like column with no CHECK

account_data_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE account_data ADD CONSTRAINT account_data_account_data_type_check CHECK (account_data_type IN (...));
F116application_services_state stateundocumented-enum

Enum-like column with no CHECK

state is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE application_services_state ADD CONSTRAINT application_services_state_state_check CHECK (state IN (...));
F117current_state_delta_stream typeundocumented-enum

Enum-like column with no CHECK

type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE current_state_delta_stream ADD CONSTRAINT current_state_delta_stream_type_check CHECK (type IN (...));
F118current_state_events typeundocumented-enum

Enum-like column with no CHECK

type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE current_state_events ADD CONSTRAINT current_state_events_type_check CHECK (type IN (...));
F119event_auth_chain_to_calculate typeundocumented-enum

Enum-like column with no CHECK

type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE event_auth_chain_to_calculate ADD CONSTRAINT event_auth_chain_to_calculate_type_check CHECK (type IN (...));
F120event_relations relation_typeundocumented-enum

Enum-like column with no CHECK

relation_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE event_relations ADD CONSTRAINT event_relations_relation_type_check CHECK (relation_type IN (...));
F111event_txn_id token_idfk-index

Foreign key without index

PostgreSQL does not index FK columns automatically. Every DELETE/UPDATE on access_tokens must scan event_txn_id to check the constraint, and every join from the parent side is a sequential scan. The scan cost grows with the child table forever, so this gets worse on its own. An index is not free. Every write to event_txn_id maintains it — insert, update and delete alike — and it takes disk. Weigh that against how often access_tokens rows are actually deleted or re-keyed — if the answer is never, the scan never happens and the index only costs.

Fix Add an index on the FK column(s).

CREATE INDEX CONCURRENTLY idx_event_txn_id_token_id ON event_txn_id(token_id);
F121events typeundocumented-enum

Enum-like column with no CHECK

type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE events ADD CONSTRAINT events_type_check CHECK (type IN (...));
F122federation_stream_position typeundocumented-enum

Enum-like column with no CHECK

type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE federation_stream_position ADD CONSTRAINT federation_stream_position_type_check CHECK (type IN (...));
F123local_media_repository media_typeundocumented-enum

Enum-like column with no CHECK

media_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE local_media_repository ADD CONSTRAINT local_media_repository_media_type_check CHECK (media_type IN (...));
F124local_media_repository_thumbnails thumbnail_typeundocumented-enum

Enum-like column with no CHECK

thumbnail_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE local_media_repository_thumbnails ADD CONSTRAINT local_media_repository_thumbnails_thumbnail_type_check CHECK (thumbnail_type IN (...));
F125presence stateundocumented-enum

Enum-like column with no CHECK

state is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE presence ADD CONSTRAINT presence_state_check CHECK (state IN (...));
F126presence_stream stateundocumented-enum

Enum-like column with no CHECK

state is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE presence_stream ADD CONSTRAINT presence_stream_state_check CHECK (state IN (...));
F127pushers kindundocumented-enum

Enum-like column with no CHECK

kind is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE pushers ADD CONSTRAINT pushers_kind_check CHECK (kind IN (...));
F128receipts_graph receipt_typeundocumented-enum

Enum-like column with no CHECK

receipt_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE receipts_graph ADD CONSTRAINT receipts_graph_receipt_type_check CHECK (receipt_type IN (...));
F129receipts_linearized receipt_typeundocumented-enum

Enum-like column with no CHECK

receipt_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE receipts_linearized ADD CONSTRAINT receipts_linearized_receipt_type_check CHECK (receipt_type IN (...));
F130remote_media_cache media_typeundocumented-enum

Enum-like column with no CHECK

media_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE remote_media_cache ADD CONSTRAINT remote_media_cache_media_type_check CHECK (media_type IN (...));
F131remote_media_cache_thumbnails thumbnail_typeundocumented-enum

Enum-like column with no CHECK

thumbnail_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE remote_media_cache_thumbnails ADD CONSTRAINT remote_media_cache_thumbnails_thumbnail_type_check CHECK (thumbnail_type IN (...));
F132room_account_data account_data_typeundocumented-enum

Enum-like column with no CHECK

account_data_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE room_account_data ADD CONSTRAINT room_account_data_account_data_type_check CHECK (account_data_type IN (...));
F133room_stats_state history_visibilityundocumented-enum

Enum-like column with no CHECK

history_visibility is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE room_stats_state ADD CONSTRAINT room_stats_state_history_visibility_check CHECK (history_visibility IN (...));
F134room_stats_state room_typeundocumented-enum

Enum-like column with no CHECK

room_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE room_stats_state ADD CONSTRAINT room_stats_state_room_type_check CHECK (room_type IN (...));
F135sessions session_typeundocumented-enum

Enum-like column with no CHECK

session_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE sessions ADD CONSTRAINT sessions_session_type_check CHECK (session_type IN (...));
F136state_events typeundocumented-enum

Enum-like column with no CHECK

type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE state_events ADD CONSTRAINT state_events_type_check CHECK (type IN (...));
F137state_events prev_stateundocumented-enum

Enum-like column with no CHECK

prev_state is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE state_events ADD CONSTRAINT state_events_prev_state_check CHECK (prev_state IN (...));
F140state_groups_state typeundocumented-enum

Enum-like column with no CHECK

type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE state_groups_state ADD CONSTRAINT state_groups_state_type_check CHECK (type IN (...));
F138ui_auth_sessions_credentials stage_typeundocumented-enum

Enum-like column with no CHECK

stage_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE ui_auth_sessions_credentials ADD CONSTRAINT ui_auth_sessions_credentials_stage_type_check CHECK (stage_type IN (...));
F139users user_typeundocumented-enum

Enum-like column with no CHECK

user_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.

Fix Add a CHECK constraint (cheap, easy to evolve) or a lookup table if values need metadata. Avoid native ENUM types unless the set is truly frozen.

ALTER TABLE users ADD CONSTRAINT users_user_type_check CHECK (user_type IN (...));

Notes (123)

F112access_tokens refresh_token_idfk-nullable

Nullable foreign key

access_tokens.refresh_token_id may be NULL, so the relationship to refresh_tokens is optional. That is legitimate (e.g. approved_by before approval) but often a modelling shrug: a row with no owner, or two nullable FKs that are secretly an either/or.

Fix Confirm the optionality is a domain rule; document it in the column comment.

F145account_dataorphan-table

Isolated table

account_data references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F146account_validityorphan-table

Isolated table

account_validity references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

application_services_state references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

application_services_txns references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F149appservice_room_listorphan-table

Isolated table

appservice_room_list references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

appservice_stream_position references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F151batch_eventsorphan-table

Isolated table

batch_events references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F152blocked_roomsorphan-table

Isolated table

blocked_rooms references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

cache_invalidation_stream_by_instance references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

current_state_delta_stream references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F155current_state_eventsorphan-table

Isolated table

current_state_events references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F156dehydrated_devicesorphan-table

Isolated table

dehydrated_devices references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F157deleted_pushersorphan-table

Isolated table

deleted_pushers references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F158device_auth_providersorphan-table

Isolated table

device_auth_providers references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F159device_federation_inboxorphan-table

Isolated table

device_federation_inbox references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F160device_federation_outboxorphan-table

Isolated table

device_federation_outbox references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F161device_inboxorphan-table

Isolated table

device_inbox references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

device_lists_changes_in_room references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

device_lists_outbound_last_success references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

device_lists_outbound_pokes references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

device_lists_remote_cache references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

device_lists_remote_extremeties references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

device_lists_remote_resync references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F168device_lists_streamorphan-table

Isolated table

device_lists_stream references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F169devicesorphan-table

Isolated table

devices references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F170e2e_cross_signing_keysorphan-table

Isolated table

e2e_cross_signing_keys references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

e2e_cross_signing_signatures references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F172e2e_device_keys_jsonorphan-table

Isolated table

e2e_device_keys_json references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F173e2e_fallback_keys_jsonorphan-table

Isolated table

e2e_fallback_keys_json references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F174e2e_one_time_keys_jsonorphan-table

Isolated table

e2e_one_time_keys_json references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F175e2e_room_keysorphan-table

Isolated table

e2e_room_keys references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F176e2e_room_keys_versionsorphan-table

Isolated table

e2e_room_keys_versions references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F177erased_usersorphan-table

Isolated table

erased_users references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F178event_authorphan-table

Isolated table

event_auth references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F179event_auth_chain_linksorphan-table

Isolated table

event_auth_chain_links references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

event_auth_chain_to_calculate references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F181event_auth_chainsorphan-table

Isolated table

event_auth_chains references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

event_backward_extremities references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F183event_expiryorphan-table

Isolated table

event_expiry references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

event_forward_extremities references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F185event_jsonorphan-table

Isolated table

event_json references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F186event_labelsorphan-table

Isolated table

event_labels references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F187event_push_actionsorphan-table

Isolated table

event_push_actions references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

event_push_actions_staging references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F189event_push_summaryorphan-table

Isolated table

event_push_summary references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

event_push_summary_last_receipt_stream_id references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

event_push_summary_stream_ordering references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F192event_relationsorphan-table

Isolated table

event_relations references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F193event_reportsorphan-table

Isolated table

event_reports references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F194event_searchorphan-table

Isolated table

event_search references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F195event_to_state_groupsorphan-table

Isolated table

event_to_state_groups references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F196ex_outlier_streamorphan-table

Isolated table

ex_outlier_stream references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

federation_inbound_events_staging references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

federation_stream_position references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F199ignored_usersorphan-table

Isolated table

ignored_users references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F200insertion_event_edgesorphan-table

Isolated table

insertion_event_edges references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

insertion_event_extremities references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F202insertion_eventsorphan-table

Isolated table

insertion_events references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F203instance_maporphan-table

Isolated table

instance_map references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F204local_current_membershiporphan-table

Isolated table

local_current_membership references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F205local_media_repositoryorphan-table

Isolated table

local_media_repository references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

local_media_repository_thumbnails references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

local_media_repository_url_cache references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F208monthly_active_usersorphan-table

Isolated table

monthly_active_users references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F209open_id_tokensorphan-table

Isolated table

open_id_tokens references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F210presenceorphan-table

Isolated table

presence references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F211presence_streamorphan-table

Isolated table

presence_stream references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F212profilesorphan-table

Isolated table

profiles references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F213push_rulesorphan-table

Isolated table

push_rules references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F214push_rules_enableorphan-table

Isolated table

push_rules_enable references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F215push_rules_streamorphan-table

Isolated table

push_rules_stream references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F216pusher_throttleorphan-table

Isolated table

pusher_throttle references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F217pushersorphan-table

Isolated table

pushers references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F218ratelimit_overrideorphan-table

Isolated table

ratelimit_override references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F219receipts_graphorphan-table

Isolated table

receipts_graph references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F220receipts_linearizedorphan-table

Isolated table

receipts_linearized references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F221received_transactionsorphan-table

Isolated table

received_transactions references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F222redactionsorphan-table

Isolated table

redactions references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F113refresh_tokens next_token_idfk-nullable

Nullable foreign key

refresh_tokens.next_token_id may be NULL, so the relationship to refresh_tokens is optional. That is legitimate (e.g. approved_by before approval) but often a modelling shrug: a row with no owner, or two nullable FKs that are secretly an either/or.

Fix Confirm the optionality is a domain rule; document it in the column comment.

F223registration_tokensorphan-table

Isolated table

registration_tokens references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F224rejectionsorphan-table

Isolated table

rejections references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F225remote_media_cacheorphan-table

Isolated table

remote_media_cache references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

remote_media_cache_thumbnails references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F227room_account_dataorphan-table

Isolated table

room_account_data references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F228room_alias_serversorphan-table

Isolated table

room_alias_servers references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F229room_aliasesorphan-table

Isolated table

room_aliases references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F230room_depthorphan-table

Isolated table

room_depth references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F231room_membershipsorphan-table

Isolated table

room_memberships references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F232room_retentionorphan-table

Isolated table

room_retention references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F233room_stats_currentorphan-table

Isolated table

room_stats_current references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

room_stats_earliest_token references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F235room_stats_stateorphan-table

Isolated table

room_stats_state references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F236room_tagsorphan-table

Isolated table

room_tags references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F237room_tags_revisionsorphan-table

Isolated table

room_tags_revisions references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F238server_keys_jsonorphan-table

Isolated table

server_keys_json references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F239server_signature_keysorphan-table

Isolated table

server_signature_keys references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F240sessionsorphan-table

Isolated table

sessions references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F241state_eventsorphan-table

Isolated table

state_events references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F263state_group_edgesorphan-table

Isolated table

state_group_edges references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F264state_groupsorphan-table

Isolated table

state_groups references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F265state_groups_stateorphan-table

Isolated table

state_groups_state references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

stats_incremental_position references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

stream_ordering_to_exterm references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F244stream_positionsorphan-table

Isolated table

stream_positions references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

threepid_guest_access_tokens references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

threepid_validation_session references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

threepid_validation_token references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F248user_daily_visitsorphan-table

Isolated table

user_daily_visits references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F249user_directoryorphan-table

Isolated table

user_directory references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F250user_directory_searchorphan-table

Isolated table

user_directory_search references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

user_directory_stream_pos references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F252user_external_idsorphan-table

Isolated table

user_external_ids references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F253user_filtersorphan-table

Isolated table

user_filters references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F254user_ipsorphan-table

Isolated table

user_ips references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F255user_signature_streamorphan-table

Isolated table

user_signature_stream references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F256user_stats_currentorphan-table

Isolated table

user_stats_current references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F257user_threepid_id_serverorphan-table

Isolated table

user_threepid_id_server references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F258user_threepidsorphan-table

Isolated table

user_threepids references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F259users_in_public_roomsorphan-table

Isolated table

users_in_public_rooms references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

users_pending_deactivation references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Isolated table

users_who_share_private_rooms references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

F262worker_locksorphan-table

Isolated table

worker_locks references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.

Fix Document its purpose or drop it.

Schema

Schema map: 137 tables, 14 foreign keys, 14 domains. Click to open the 3D explorer.Accounts and identityaccount_validityerased_usersignored_usersprofilesregistration_tokensthreepid_guest_access_tokensthreepid_validation_sessionthreepid_validation_tokenuser_external_idsuser_filtersuser_threepid_id_serveruser_threepidsusersusers_pending_deactivationSessions and tokensdevice_auth_providersopen_id_tokensrefresh_tokenssessionsui_auth_sessionsaccess_tokensui_auth_sessions_credentialsui_auth_sessions_ipsDevices and device listsdehydrated_devicesdevice_federation_inboxdevice_federation_outboxdevice_inboxdevice_lists_changes_in_roomdevice_lists_outbound_last_successdevice_lists_outbound_pokesdevice_lists_remote_cachedevice_lists_remote_extremetiesdevice_lists_remote_resyncdevice_lists_streamdevicesEnd-to-end encryptione2e_cross_signing_keyse2e_cross_signing_signaturese2e_device_keys_jsone2e_fallback_keys_jsone2e_one_time_keys_jsone2e_room_keyse2e_room_keys_versionsuser_signature_streamRooms and membershipaccount_datablocked_roomslocal_current_membershiproom_account_dataroom_alias_serversroom_aliasesroom_depthroom_membershipsroom_retentionroom_tagsroom_tags_revisionsroomsThe event graphbatch_eventsevent_authevent_auth_chain_linksevent_auth_chain_to_calculateevent_auth_chainsevent_backward_extremitiesevent_expiryevent_forward_extremitiesevent_jsonevent_labelsevent_relationsevent_reportsevent_searcheventsex_outlier_streaminsertion_event_edgesinsertion_event_extremitiesinsertion_eventsredactionsrejectionsstream_ordering_to_extermevent_edgesevent_txn_idRoom statecurrent_state_delta_streamcurrent_state_eventsevent_to_state_groupsstate_eventsstate_group_edgesstate_groupsstate_groups_stateFederationdestinationsfederation_inbound_events_stagingfederation_stream_positionreceived_transactionsserver_keys_jsonserver_signature_keysdestination_roomspartial_state_roomspartial_state_eventspartial_state_rooms_serversApplication servicesapplication_services_stateapplication_services_txnsappservice_room_listappservice_stream_positionPush notificationsdeleted_pushersevent_push_actionsevent_push_actions_stagingevent_push_summaryevent_push_summary_last_receipt_stream_idevent_push_summary_stream_orderingpush_rulespush_rules_enablepush_rules_streampusher_throttlepushersReceipts and presencepresencepresence_streamreceipts_graphreceipts_linearizedusers_to_send_full_presence_toMedia repositorylocal_media_repositorylocal_media_repository_thumbnailslocal_media_repository_url_cacheremote_media_cacheremote_media_cache_thumbnailsUser directory and statisticsmonthly_active_usersroom_stats_currentroom_stats_earliest_tokenroom_stats_statestats_incremental_positionuser_daily_visitsuser_directoryuser_directory_searchuser_directory_stream_posuser_ipsuser_stats_currentusers_in_public_roomsusers_who_share_private_roomsWorker coordinationcache_invalidation_stream_by_instanceinstance_mapratelimit_overridestream_positionsworker_locks

137 tables · 14 foreign keys · 14 domains. Open the 3D explorer: rotate, zoom, click any table or relationship.

Accounts and identity 14 tables

Local accounts, profiles, third-party identifiers (email and phone), registration tokens, and the flags for deactivated or erased users.

Entity-relationship diagram: users, profiles, user_external_ids, user_threepids, user_threepid_id_server, threepid_validation_session, threepid_validation_token, threepid_guest_access_tokens, erased_users, users_pending_deactivation, account_validity, registration_tokens, user_filters, ignored_usersusersnametextpassword_hashtextcreation_tsbigintadminsmallintupgrade_tsbigintis_guestsmallintappservice_idtextconsent_versiontextconsent_server_notice_senttextuser_typetextdeactivatedsmallintshadow_bannedbooleanconsent_tsbigintprofilesuser_idtextdisplaynametextavatar_urltextuser_external_idsauth_providertextexternal_idtextuser_idtextuser_threepidsuser_idtextmediumtextaddresstextvalidated_atbigintadded_atbigintuser_threepid_id_serveruser_idtextmediumtextaddresstextid_servertextthreepid_validation_sessionsession_id PKtextmediumtextaddresstextclient_secrettextlast_send_attemptbigintvalidated_atbigintthreepid_validation_tokentoken PKtextsession_idtextnext_linktextexpiresbigintthreepid_guest_access_tokensmediumtextaddresstextguest_access_tokentextfirst_invitertexterased_usersuser_idtextusers_pending_deactivationuser_idtextaccount_validityuser_id PKtextexpiration_ts_msbigintemail_sentbooleanrenewal_tokentexttoken_used_ts_msbigintregistration_tokenstokentextuses_allowedintegerpendingintegercompletedintegerexpiry_timebigintuser_filtersuser_idtextfilter_idbigintfilter_jsonbyteaignored_usersignorer_user_idtextignored_user_idtext

Relationships

No foreign keys in this domain.

users

13 cols · no RLS · line 943View in 3D
  • Enum-like column with no CHECK user_type — user_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
ColumnTypeNullDefaultReferencesNotes
name UKtextnull
password_hash textnull
creation_ts bigintnull
admin smallintNOT NULL0
upgrade_ts bigintnull
is_guest smallintNOT NULL0
appservice_id textnull
consent_version textnull
consent_server_notice_sent textnull
user_type textnull
deactivated smallintNOT NULL0
shadow_banned booleannull
consent_ts bigintnull

Indexes

  • (creation_ts) users_creation_ts

Referenced by

profiles

3 cols · no RLS · line 568View in 3D
  • Isolated table — profiles references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id UKtextNOT NULL
displayname textnull
avatar_url textnull

Indexes

  • none

Referenced by

  • nothing

user_external_ids

3 cols · no RLS · line 896View in 3D
  • Isolated table — user_external_ids references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
auth_provider textNOT NULL
external_id textNOT NULL
user_id textNOT NULL

Indexes

  • (user_id) user_external_ids_user_id_idx

Referenced by

  • nothing

user_threepids

5 cols · no RLS · line 936View in 3D
  • Isolated table — user_threepids references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
medium textNOT NULL
address textNOT NULL
validated_at bigintNOT NULL
added_at bigintNOT NULL

Indexes

  • (medium, address) user_threepids_medium_address
  • (user_id) user_threepids_user_id

Referenced by

  • nothing

user_threepid_id_server

4 cols · no RLS · line 930View in 3D
  • Isolated table — user_threepid_id_server references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
medium textNOT NULL
address textNOT NULL
id_server textNOT NULL

Indexes

  • UNIQUE (user_id, medium, address, id_server) user_threepid_id_server_idx

Referenced by

  • nothing

threepid_validation_session

6 cols · no RLS · line 842View in 3D
  • Isolated table — threepid_validation_session references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
session_id PKtextNOT NULL
medium textNOT NULL
address textNOT NULL
client_secret textNOT NULL
last_send_attempt bigintNOT NULL
validated_at bigintnull

Indexes

  • none

Referenced by

  • nothing

threepid_validation_token

4 cols · no RLS · line 850View in 3D
  • Isolated table — threepid_validation_token references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
token PKtextNOT NULL
session_id textNOT NULL
next_link textnull
expires bigintNOT NULL

Indexes

  • (session_id) threepid_validation_token_session_id

Referenced by

  • nothing

threepid_guest_access_tokens

4 cols · no RLS · line 836View in 3D
  • Isolated table — threepid_guest_access_tokens references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
medium textnull
address textnull
guest_access_token textnull
first_inviter textnull

Indexes

  • UNIQUE (medium, address) threepid_guest_access_tokens_index

Referenced by

  • nothing

erased_users

1 cols · no RLS · line 271View in 3D
  • Isolated table — erased_users references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL

Indexes

  • UNIQUE (user_id) erased_users_user

Referenced by

  • nothing

users_pending_deactivation

1 cols · no RLS · line 962View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — users_pending_deactivation references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL

Indexes

  • none

Referenced by

  • nothing

account_validity

5 cols · no RLS · line 40View in 3D
  • Isolated table — account_validity references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id PKtextNOT NULL
expiration_ts_ms bigintNOT NULL
email_sent booleanNOT NULL
renewal_token textnull
token_used_ts_ms bigintnull

Indexes

  • none

Referenced by

  • nothing

registration_tokens

5 cols · no RLS · line 675View in 3D
  • Isolated table — registration_tokens references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
token UKtextNOT NULL
uses_allowed integernull
pending integerNOT NULL
completed integerNOT NULL
expiry_time bigintnull

Indexes

  • none

Referenced by

  • nothing

user_filters

3 cols · no RLS · line 901View in 3D
  • Isolated table — user_filters references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
filter_id bigintNOT NULL
filter_json byteaNOT NULL

Indexes

  • UNIQUE (user_id, filter_id) user_filters_unique

Referenced by

  • nothing

ignored_users

2 cols · no RLS · line 460View in 3D
  • Isolated table — ignored_users references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
ignorer_user_id textNOT NULL
ignored_user_id textNOT NULL

Indexes

  • (ignored_user_id) ignored_users_ignored_user_id
  • UNIQUE (ignorer_user_id, ignored_user_id) ignored_users_uniqueness

Referenced by

  • nothing

Sessions and tokens 8 tables

How a client proves who it is: access and refresh tokens, OpenID tokens, and the multi-stage interactive auth sessions used for login and account changes.

Entity-relationship diagram: access_tokens, refresh_tokens, open_id_tokens, ui_auth_sessions, ui_auth_sessions_credentials, ui_auth_sessions_ips, sessions, device_auth_providersaccess_tokensid PKbigintuser_idtextdevice_idtexttokentextvalid_until_msbigintpuppets_user_idtextlast_validatedbigintrefresh_token_id FKbigintusedbooleanrefresh_tokensid PKbigintuser_idtextdevice_idtexttokentextnext_token_id FKbigintexpiry_tsbigintultimate_session_expiry_tsbigintopen_id_tokenstoken PKtextts_valid_until_msbigintuser_idtextui_auth_sessionssession_idtextcreation_timebigintserverdicttextclientdicttexturitextmethodtextdescriptiontextui_auth_sessions_credentialssession_id FKtextstage_typetextresulttextui_auth_sessions_ipssession_id FKtextiptextuser_agenttextsessionssession_typetextsession_idtextvaluetextexpiry_time_msbigintdevice_auth_providersuser_idtextdevice_idtextauth_provider_idtextauth_provider_session_idtextnext_token_idrefresh_token_idsession_idsession_id

Relationships

access_tokens

9 cols · no RLS · line 16View in 3D
  • Foreign key without index refresh_token_id — PostgreSQL does not index FK columns automatically. Every DELETE/UPDATE on refresh_tokens must scan access_tokens to check the constraint, and every join from the parent side is a sequential scan. The scan cost grows with the child table forever, so this gets worse on its own. An index is not free. Every write to access_tokens maintains it — insert, update and delete alike — and it takes disk. Weigh that against how often refresh_tokens rows are actually deleted or re-keyed — if the answer is never, the scan never happens and the index only costs.
  • Nullable foreign key refresh_token_id — access_tokens.refresh_token_id may be NULL, so the relationship to refresh_tokens is optional. That is legitimate (e.g. approved_by before approval) but often a modelling shrug: a row with no owner, or two nullable FKs that are secretly an either/or.
ColumnTypeNullDefaultReferencesNotes
id PKbigintNOT NULL
user_id textNOT NULL
device_id textnull
token UKtextNOT NULL
valid_until_ms bigintnull
puppets_user_id textnull
last_validated bigintnull
refresh_token_id bigintnullrefresh_tokens.id 1:N · CASCADE
used booleannull

Indexes

  • (user_id, device_id) access_tokens_device_id

Referenced by

refresh_tokens

7 cols · no RLS · line 666View in 3D
  • Nullable foreign key next_token_id — refresh_tokens.next_token_id may be NULL, so the relationship to refresh_tokens is optional. That is legitimate (e.g. approved_by before approval) but often a modelling shrug: a row with no owner, or two nullable FKs that are secretly an either/or.
ColumnTypeNullDefaultReferencesNotes
id PKbigintNOT NULL
user_id textNOT NULL
device_id textNOT NULL
token UKtextNOT NULL
next_token_id bigintnullrefresh_tokens.id 1:N · CASCADE
expiry_ts bigintnull
ultimate_session_expiry_ts bigintnull

Indexes

  • (next_token_id) WHERE next_token_id IS NOT NULL refresh_tokens_next_token_id

Referenced by

open_id_tokens

3 cols · no RLS · line 529View in 3D
  • Isolated table — open_id_tokens references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
token PKtextNOT NULL
ts_valid_until_ms bigintNOT NULL
user_id textNOT NULL

Indexes

  • (ts_valid_until_ms) open_id_tokens_ts_valid_until_ms

Referenced by

  • nothing

ui_auth_sessions

7 cols · no RLS · line 856View in 3D
ColumnTypeNullDefaultReferencesNotes
session_id UKtextNOT NULL
creation_time bigintNOT NULL
serverdict textNOT NULL
clientdict textNOT NULL
uri textNOT NULL
method textNOT NULL
description textNOT NULL

Indexes

  • none

Referenced by

ui_auth_sessions_credentials

3 cols · no RLS · line 865View in 3D
  • Enum-like column with no CHECK stage_type — stage_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
ColumnTypeNullDefaultReferencesNotes
session_id textNOT NULLui_auth_sessions.session_id 1:N
stage_type textNOT NULL
result textNOT NULL

Indexes

  • none

Referenced by

  • nothing

ui_auth_sessions_ips

3 cols · no RLS · line 870View in 3D
ColumnTypeNullDefaultReferencesNotes
session_id textNOT NULLui_auth_sessions.session_id 1:N
ip textNOT NULL
user_agent textNOT NULL

Indexes

  • none

Referenced by

  • nothing

sessions

4 cols · no RLS · line 808View in 3D
  • Enum-like column with no CHECK session_type — session_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — sessions references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
session_type textNOT NULL
session_id textNOT NULL
value textNOT NULL
expiry_time_ms bigintNOT NULL

Indexes

  • none

Referenced by

  • nothing

device_auth_providers

4 cols · no RLS · line 137View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — device_auth_providers references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
device_id textNOT NULL
auth_provider_id textNOT NULL
auth_provider_session_id textNOT NULL

Indexes

  • (user_id, device_id) device_auth_providers_devices
  • (auth_provider_id, auth_provider_session_id) device_auth_providers_sessions

Referenced by

  • nothing

Devices and device lists 12 tables

One row per logged-in device, the to-device message inbox, and the machinery that tells other servers when a user's device list changes.

Entity-relationship diagram: devices, dehydrated_devices, device_inbox, device_lists_stream, device_lists_changes_in_room, device_lists_outbound_pokes, device_lists_outbound_last_success, device_lists_remote_cache, device_lists_remote_extremeties, device_lists_remote_resync, device_federation_inbox, device_federation_outboxdevicesuser_idtextdevice_idtextdisplay_nametextlast_seenbigintiptextuser_agenttexthiddenbooleandehydrated_devicesuser_id PKtextdevice_idtextdevice_datatextdevice_inboxuser_idtextdevice_idtextstream_idbigintmessage_jsontextinstance_nametextdevice_lists_streamstream_idbigintuser_idtextdevice_idtextdevice_lists_changes_in_roomuser_idtextdevice_idtextroom_idtextstream_idbigintconverted_to_destinationsbooleanopentracing_contexttextdevice_lists_outbound_pokesdestinationtextstream_idbigintuser_idtextdevice_idtextsentbooleantsbigintopentracing_contexttextdevice_lists_outbound_last_successdestinationtextuser_idtextstream_idbigintdevice_lists_remote_cacheuser_idtextdevice_idtextcontenttextdevice_lists_remote_extremetiesuser_idtextstream_idtextdevice_lists_remote_resyncuser_idtextadded_tsbigintdevice_federation_inboxorigintextmessage_idtextreceived_tsbigintinstance_nametextdevice_federation_outboxdestinationtextstream_idbigintqueued_tsbigintmessages_jsontextinstance_nametext

Relationships

No foreign keys in this domain.

devices

7 cols · no RLS · line 209View in 3D
  • Isolated table — devices references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
device_id textNOT NULL
display_name textnull
last_seen bigintnull
ip textnull
user_agent textnull
hidden booleannullFALSE

Indexes

  • none

Referenced by

  • nothing

dehydrated_devices

3 cols · no RLS · line 114View in 3D
  • Isolated table — dehydrated_devices references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id PKtextNOT NULL
device_id textNOT NULL
device_data textNOT NULL

Indexes

  • none

Referenced by

  • nothing

device_inbox

5 cols · no RLS · line 156View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — device_inbox references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
device_id textNOT NULL
stream_id bigintNOT NULL
message_json textNOT NULL
instance_name textnull

Indexes

  • (stream_id, user_id) device_inbox_stream_id_user_id
  • (user_id, device_id, stream_id) device_inbox_user_stream_id

Referenced by

  • nothing

device_lists_stream

3 cols · no RLS · line 204View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — device_lists_stream references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
stream_id bigintNOT NULL
user_id textNOT NULL
device_id textNOT NULL

Indexes

  • (stream_id, user_id) device_lists_stream_id
  • (user_id, device_id) device_lists_stream_user_id

Referenced by

  • nothing

device_lists_changes_in_room

6 cols · no RLS · line 169View in 3D
  • Isolated table — device_lists_changes_in_room references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
device_id textNOT NULL
room_id textNOT NULL
stream_id bigintNOT NULL
converted_to_destinations booleanNOT NULL
opentracing_context textnull

Indexes

  • UNIQUE (stream_id, room_id) device_lists_changes_in_stream_id
  • (stream_id) WHERE NOT converted_to_destinations device_lists_changes_in_stream_id_unconverted

Referenced by

  • nothing

device_lists_outbound_pokes

7 cols · no RLS · line 182View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — device_lists_outbound_pokes references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
destination textNOT NULL
stream_id bigintNOT NULL
user_id textNOT NULL
device_id textNOT NULL
sent booleanNOT NULL
ts bigintNOT NULL
opentracing_context textnull

Indexes

  • (destination, stream_id) device_lists_outbound_pokes_id
  • (stream_id) device_lists_outbound_pokes_stream
  • (destination, user_id) device_lists_outbound_pokes_user

Referenced by

  • nothing

device_lists_outbound_last_success

3 cols · no RLS · line 177View in 3D
  • Isolated table — device_lists_outbound_last_success references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
destination textNOT NULL
user_id textNOT NULL
stream_id bigintNOT NULL

Indexes

  • UNIQUE (destination, user_id) device_lists_outbound_last_success_unique_idx

Referenced by

  • nothing

device_lists_remote_cache

3 cols · no RLS · line 191View in 3D
  • Isolated table — device_lists_remote_cache references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
device_id textNOT NULL
content textNOT NULL

Indexes

  • UNIQUE (user_id, device_id) device_lists_remote_cache_unique_id

Referenced by

  • nothing

device_lists_remote_extremeties

2 cols · no RLS · line 196View in 3D
  • Isolated table — device_lists_remote_extremeties references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
stream_id textNOT NULL

Indexes

  • UNIQUE (user_id) device_lists_remote_extremeties_unique_idx

Referenced by

  • nothing

device_lists_remote_resync

2 cols · no RLS · line 200View in 3D
  • Isolated table — device_lists_remote_resync references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
added_ts bigintNOT NULL

Indexes

  • UNIQUE (user_id) device_lists_remote_resync_idx
  • (added_ts) device_lists_remote_resync_ts_idx

Referenced by

  • nothing

device_federation_inbox

4 cols · no RLS · line 143View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — device_federation_inbox references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
origin textNOT NULL
message_id textNOT NULL
received_ts bigintNOT NULL
instance_name textnull

Indexes

  • (origin, message_id) device_federation_inbox_sender_id

Referenced by

  • nothing

device_federation_outbox

5 cols · no RLS · line 149View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — device_federation_outbox references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
destination textNOT NULL
stream_id bigintNOT NULL
queued_ts bigintNOT NULL
messages_json textNOT NULL
instance_name textnull

Indexes

  • (destination, stream_id) device_federation_outbox_destination_id
  • (stream_id) device_federation_outbox_id

Referenced by

  • nothing

End-to-end encryption 8 tables

Device keys, one-time and fallback keys, cross-signing keys and signatures, and server-side room key backups.

Entity-relationship diagram: e2e_device_keys_json, e2e_one_time_keys_json, e2e_fallback_keys_json, e2e_cross_signing_keys, e2e_cross_signing_signatures, e2e_room_keys, e2e_room_keys_versions, user_signature_streame2e_device_keys_jsonuser_idtextdevice_idtextts_added_msbigintkey_jsontexte2e_one_time_keys_jsonuser_idtextdevice_idtextalgorithmtextkey_idtextts_added_msbigintkey_jsontexte2e_fallback_keys_jsonuser_idtextdevice_idtextalgorithmtextkey_idtextkey_jsontextusedbooleane2e_cross_signing_keysuser_idtextkeytypetextkeydatatextstream_idbiginte2e_cross_signing_signaturesuser_idtextkey_idtexttarget_user_idtexttarget_device_idtextsignaturetexte2e_room_keysuser_idtextroom_idtextsession_idtextversionbigintfirst_message_indexintegerforwarded_countintegeris_verifiedbooleansession_datatexte2e_room_keys_versionsuser_idtextversionbigintalgorithmtextauth_datatextdeletedsmallintetagbigintuser_signature_streamstream_idbigintfrom_user_idtextuser_idstext

Relationships

No foreign keys in this domain.

e2e_device_keys_json

4 cols · no RLS · line 231View in 3D
  • Isolated table — e2e_device_keys_json references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
device_id textNOT NULL
ts_added_ms bigintNOT NULL
key_json textNOT NULL

Indexes

  • none

Referenced by

  • nothing

e2e_one_time_keys_json

6 cols · no RLS · line 245View in 3D
  • Isolated table — e2e_one_time_keys_json references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
device_id textNOT NULL
algorithm textNOT NULL
key_id textNOT NULL
ts_added_ms bigintNOT NULL
key_json textNOT NULL

Indexes

  • none

Referenced by

  • nothing

e2e_fallback_keys_json

6 cols · no RLS · line 237View in 3D
  • Isolated table — e2e_fallback_keys_json references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
device_id textNOT NULL
algorithm textNOT NULL
key_id textNOT NULL
key_json textNOT NULL
used booleanNOT NULLFALSE

Indexes

  • none

Referenced by

  • nothing

e2e_cross_signing_keys

4 cols · no RLS · line 218View in 3D
  • Isolated table — e2e_cross_signing_keys references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
keytype textNOT NULL
keydata textNOT NULL
stream_id bigintNOT NULL

Indexes

  • UNIQUE (user_id, keytype, stream_id) e2e_cross_signing_keys_idx
  • UNIQUE (stream_id) e2e_cross_signing_keys_stream_idx

Referenced by

  • nothing

e2e_cross_signing_signatures

5 cols · no RLS · line 224View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — e2e_cross_signing_signatures references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
key_id textNOT NULL
target_user_id textNOT NULL
target_device_id textNOT NULL
signature textNOT NULL

Indexes

  • (user_id, target_user_id, target_device_id) e2e_cross_signing_signatures2_idx

Referenced by

  • nothing

e2e_room_keys

8 cols · no RLS · line 253View in 3D
  • Isolated table — e2e_room_keys references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
room_id textNOT NULL
session_id textNOT NULL
version bigintNOT NULL
first_message_index integernull
forwarded_count integernull
is_verified booleannull
session_data textNOT NULL

Indexes

  • UNIQUE (user_id, version, room_id, session_id) e2e_room_keys_with_version_idx

Referenced by

  • nothing

e2e_room_keys_versions

6 cols · no RLS · line 263View in 3D
  • Isolated table — e2e_room_keys_versions references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
version bigintNOT NULL
algorithm textNOT NULL
auth_data textNOT NULL
deleted smallintNOT NULL0
etag bigintnull

Indexes

  • UNIQUE (user_id, version) e2e_room_keys_versions_idx

Referenced by

  • nothing

user_signature_stream

3 cols · no RLS · line 920View in 3D
  • Isolated table — user_signature_stream references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
stream_id bigintNOT NULL
from_user_id textNOT NULL
user_ids textNOT NULL

Indexes

  • UNIQUE (stream_id) user_signature_stream_idx

Referenced by

  • nothing

Rooms and membership 12 tables

Rooms, their aliases, who is in them, per-room tags and account data, retention policy and the server-level block list.

Entity-relationship diagram: rooms, room_aliases, room_alias_servers, room_memberships, local_current_membership, room_depth, room_retention, blocked_rooms, room_tags, room_tags_revisions, room_account_data, account_dataroomsroom_id PKtextis_publicbooleancreatortextroom_versiontexthas_auth_chain_indexbooleanroom_aliasesroom_aliastextroom_idtextcreatortextroom_alias_serversroom_aliastextservertextroom_membershipsevent_idtextuser_idtextsendertextroom_idtextmembershiptextforgottenintegerdisplay_nametextavatar_urltextlocal_current_membershiproom_idtextuser_idtextevent_idtextmembershiptextroom_depthroom_idtextmin_depthbigintroom_retentionroom_id PKtextevent_id PKtextmin_lifetimebigintmax_lifetimebigintblocked_roomsroom_idtextuser_idtextroom_tagsuser_idtextroom_idtexttagtextcontenttextroom_tags_revisionsuser_idtextroom_idtextstream_idbigintinstance_nametextroom_account_datauser_idtextroom_idtextaccount_data_typetextstream_idbigintcontenttextinstance_nametextaccount_datauser_idtextaccount_data_typetextstream_idbigintcontenttextinstance_nametext

Relationships

No foreign keys in this domain.

rooms

5 cols · no RLS · line 785View in 3D
ColumnTypeNullDefaultReferencesNotes
room_id PKtextNOT NULL
is_public booleannull
creator textnull
room_version textnull
has_auth_chain_index booleannull

Indexes

  • (is_public) public_room_index

Referenced by

room_aliases

3 cols · no RLS · line 720View in 3D
  • Isolated table — room_aliases references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
room_alias UKtextNOT NULL
room_id textNOT NULL
creator textnull

Indexes

  • (room_id) room_aliases_id

Referenced by

  • nothing

room_alias_servers

2 cols · no RLS · line 716View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — room_alias_servers references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
room_alias textNOT NULL
server textNOT NULL

Indexes

  • (room_alias) room_alias_servers_alias

Referenced by

  • nothing

room_memberships

8 cols · no RLS · line 729View in 3D
  • Isolated table — room_memberships references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id UKtextNOT NULL
user_id textNOT NULL
sender textNOT NULL
room_id textNOT NULL
membership textNOT NULL
forgotten integernull0
display_name textnull
avatar_url textnull

Indexes

  • (room_id) room_memberships_room_id
  • (user_id) room_memberships_user_id
  • (user_id, room_id) WHERE forgotten = 1 room_memberships_user_room_forgotten

Referenced by

  • nothing

local_current_membership

4 cols · no RLS · line 490View in 3D
  • Isolated table — local_current_membership references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
room_id textNOT NULL
user_id textNOT NULL
event_id textNOT NULL
membership textNOT NULL

Indexes

  • UNIQUE (user_id, room_id) local_current_membership_idx
  • (room_id) local_current_membership_room_idx

Referenced by

  • nothing

room_depth

2 cols · no RLS · line 725View in 3D
  • Isolated table — room_depth references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
room_id UKtextNOT NULL
min_depth bigintnull

Indexes

  • none

Referenced by

  • nothing

room_retention

4 cols · no RLS · line 739View in 3D
  • Isolated table — room_retention references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
room_id PKtextNOT NULL
event_id PKtextNOT NULL
min_lifetime bigintnull
max_lifetime bigintnull

Indexes

  • (max_lifetime) room_retention_max_lifetime_idx

Referenced by

  • nothing

blocked_rooms

2 cols · no RLS · line 81View in 3D
  • Isolated table — blocked_rooms references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
room_id textNOT NULL
user_id textNOT NULL

Indexes

  • UNIQUE (room_id) blocked_rooms_idx

Referenced by

  • nothing

room_tags

4 cols · no RLS · line 773View in 3D
  • Isolated table — room_tags references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
room_id textNOT NULL
tag textNOT NULL
content textNOT NULL

Indexes

  • none

Referenced by

  • nothing

room_tags_revisions

4 cols · no RLS · line 779View in 3D
  • Isolated table — room_tags_revisions references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
room_id textNOT NULL
stream_id bigintNOT NULL
instance_name textnull

Indexes

  • none

Referenced by

  • nothing

room_account_data

6 cols · no RLS · line 708View in 3D
  • Enum-like column with no CHECK account_data_type — account_data_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — room_account_data references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
room_id textNOT NULL
account_data_type textNOT NULL
stream_id bigintNOT NULL
content textNOT NULL
instance_name textnull

Indexes

  • (user_id, stream_id) room_account_data_stream_id

Referenced by

  • nothing

account_data

5 cols · no RLS · line 27View in 3D
  • Enum-like column with no CHECK account_data_type — account_data_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — account_data references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
account_data_type textNOT NULL
stream_id bigintNOT NULL
content textNOT NULL
instance_name textnull

Indexes

  • (user_id, stream_id) account_data_stream_id

Referenced by

  • nothing

The event graph 23 tables

The heart of a homeserver: every event, its JSON, the directed acyclic graph edges that order it, the authorisation chains, and the extremities that mark the current frontier.

Entity-relationship diagram: events, event_json, event_edges, event_auth, event_auth_chains, event_auth_chain_links, event_auth_chain_to_calculate, event_backward_extremities, event_forward_extremities, event_relations, event_labels, event_expiry, event_reports, event_search, redactions, rejections, batch_events, insertion_events, insertion_event_edges, insertion_event_extremities, ex_outlier_stream, stream_ordering_to_exterm, event_txn_ideventstopological_orderingbigintevent_idtexttypetextroom_idtextcontenttextunrecognized_keystextprocessedbooleanoutlierbooleandepthbigintorigin_server_tsbigintreceived_tsbigintsendertextcontains_urlbooleaninstance_nametextstream_orderingbigintstate_keytextrejection_reasontextevent_jsonevent_idtextroom_idtextinternal_metadatatextjsontextformat_versionintegerevent_edgesevent_id FKtextprev_event_idtextroom_idtextis_statebooleanevent_authevent_idtextauth_idtextroom_idtextevent_auth_chainsevent_id PKtextchain_idbigintsequence_numberbigintevent_auth_chain_linksorigin_chain_idbigintorigin_sequence_numberbiginttarget_chain_idbiginttarget_sequence_numberbigintevent_auth_chain_to_calculateevent_id PKtextroom_idtexttypetextstate_keytextevent_backward_extremitiesevent_idtextroom_idtextevent_forward_extremitiesevent_idtextroom_idtextevent_relationsevent_idtextrelates_to_idtextrelation_typetextaggregation_keytextevent_labelsevent_id PKtextlabel PKtextroom_idtexttopological_orderingbigintevent_expiryevent_id PKtextexpiry_tsbigintevent_reportsid PKbigintreceived_tsbigintroom_idtextevent_idtextuser_idtextreasontextcontenttextevent_searchevent_idtextroom_idtextsendertextkeytextvectortsvectororigin_server_tsbigintstream_orderingbigintredactionsevent_idtextredactstexthave_censoredbooleanreceived_tsbigintrejectionsevent_idtextreasontextlast_checktextbatch_eventsevent_idtextroom_idtextbatch_idtextinsertion_eventsevent_idtextroom_idtextnext_batch_idtextinsertion_event_edgesevent_idtextroom_idtextinsertion_prev_event_idtextinsertion_event_extremitiesevent_idtextroom_idtextex_outlier_streamevent_stream_ordering PKbigintevent_idtextstate_groupbigintinstance_nametextstream_ordering_to_extermstream_orderingbigintroom_idtextevent_idtextevent_txn_idevent_id FKtextroom_idtextuser_idtexttoken_id FKbiginttxn_idtextinserted_tsbigintaccess_tokensevent_idevent_idtoken_id

Relationships

events

17 cols · no RLS · line 410View in 3D
  • Enum-like column with no CHECK type — type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
ColumnTypeNullDefaultReferencesNotes
topological_ordering bigintNOT NULL
event_id UKtextNOT NULL
type textNOT NULL
room_id textNOT NULL
content textnull
unrecognized_keys textnull
processed booleanNOT NULL
outlier booleanNOT NULL
depth bigintNOT NULL0
origin_server_ts bigintnull
received_ts bigintnull
sender textnull
contains_url booleannull
instance_name textnull
stream_ordering bigintnull
state_key textnull
rejection_reason textnull

Indexes

  • (room_id, topological_ordering, stream_ordering) WHERE contains_url = TRUE AND outlier = FALSE event_contains_url_index
  • (room_id, topological_ordering, stream_ordering) events_order_room
  • (room_id, stream_ordering) events_room_stream
  • UNIQUE (stream_ordering) events_stream_ordering
  • (origin_server_ts, stream_ordering) events_ts

Referenced by

event_json

5 cols · no RLS · line 320View in 3D
  • Isolated table — event_json references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id UKtextNOT NULL
room_id textNOT NULL
internal_metadata textNOT NULL
json textNOT NULL
format_version integernull

Indexes

  • none

Referenced by

  • nothing

event_edges

4 cols · no RLS · line 306View in 3D
ColumnTypeNullDefaultReferencesNotes
event_id textNOT NULLevents.event_id 1:N
prev_event_id textNOT NULL
room_id textnull
is_state booleanNOT NULLFALSE

Indexes

  • (prev_event_id) ev_edges_prev_id
  • UNIQUE (event_id, prev_event_id) event_edges_event_id_prev_event_id_idx

Referenced by

  • nothing

event_auth

3 cols · no RLS · line 274View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — event_auth references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id textNOT NULL
auth_id textNOT NULL
room_id textNOT NULL

Indexes

  • (event_id) evauth_edges_id

Referenced by

  • nothing

event_auth_chains

3 cols · no RLS · line 297View in 3D
  • Isolated table — event_auth_chains references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id PKtextNOT NULL
chain_id bigintNOT NULL
sequence_number bigintNOT NULL

Indexes

  • UNIQUE (chain_id, sequence_number) event_auth_chains_c_seq_index

Referenced by

  • nothing

event_auth_chain_to_calculate

4 cols · no RLS · line 291View in 3D
  • Enum-like column with no CHECK type — type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — event_auth_chain_to_calculate references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id PKtextNOT NULL
room_id textNOT NULL
type textNOT NULL
state_key textNOT NULL

Indexes

  • (room_id) event_auth_chain_to_calculate_rm_id

Referenced by

  • nothing

event_backward_extremities

2 cols · no RLS · line 302View in 3D
  • Isolated table — event_backward_extremities references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id textNOT NULL
room_id textNOT NULL

Indexes

  • (event_id) ev_b_extrem_id
  • (room_id) ev_b_extrem_room

Referenced by

  • nothing

event_forward_extremities

2 cols · no RLS · line 316View in 3D
  • Isolated table — event_forward_extremities references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id textNOT NULL
room_id textNOT NULL

Indexes

  • (event_id) ev_extrem_id
  • (room_id) ev_extrem_room

Referenced by

  • nothing

event_relations

4 cols · no RLS · line 374View in 3D
  • Enum-like column with no CHECK relation_type — relation_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — event_relations references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id textNOT NULL
relates_to_id textNOT NULL
relation_type textNOT NULL
aggregation_key textnull

Indexes

  • UNIQUE (event_id) event_relations_id
  • (relates_to_id, relation_type, aggregation_key) event_relations_relates

Referenced by

  • nothing

event_labels

4 cols · no RLS · line 327View in 3D
  • Isolated table — event_labels references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id PKtextNOT NULL
label PKtextNOT NULL
room_id textNOT NULL
topological_ordering bigintNOT NULL

Indexes

  • (room_id, label, topological_ordering) event_labels_room_id_label_idx

Referenced by

  • nothing

event_expiry

2 cols · no RLS · line 312View in 3D
  • Isolated table — event_expiry references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id PKtextNOT NULL
expiry_ts bigintNOT NULL

Indexes

  • (expiry_ts) event_expiry_expiry_ts_idx

Referenced by

  • nothing

event_reports

7 cols · no RLS · line 380View in 3D
  • Isolated table — event_reports references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
id PKbigintNOT NULL
received_ts bigintNOT NULL
room_id textNOT NULL
event_id textNOT NULL
user_id textNOT NULL
reason textnull
content textnull

Indexes

  • none

Referenced by

  • nothing

redactions

4 cols · no RLS · line 660View in 3D
  • Isolated table — redactions references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id UKtextNOT NULL
redacts textNOT NULL
have_censored booleanNOT NULLFALSE
received_ts bigintnull

Indexes

  • (received_ts) WHERE NOT have_censored redactions_have_censored_ts
  • (redacts) redactions_redacts

Referenced by

  • nothing

rejections

3 cols · no RLS · line 682View in 3D
  • Isolated table — rejections references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id UKtextNOT NULL
reason textNOT NULL
last_check textNOT NULL

Indexes

  • none

Referenced by

  • nothing

batch_events

3 cols · no RLS · line 76View in 3D
  • Isolated table — batch_events references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id textNOT NULL
room_id textNOT NULL
batch_id textNOT NULL

Indexes

  • (batch_id) batch_events_batch_id
  • UNIQUE (event_id) chunk_events_event_id

Referenced by

  • nothing

insertion_events

3 cols · no RLS · line 473View in 3D
  • Isolated table — insertion_events references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id textNOT NULL
room_id textNOT NULL
next_batch_id textNOT NULL

Indexes

  • UNIQUE (event_id) insertion_events_event_id
  • (next_batch_id) insertion_events_next_batch_id

Referenced by

  • nothing

insertion_event_edges

3 cols · no RLS · line 464View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — insertion_event_edges references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id textNOT NULL
room_id textNOT NULL
insertion_prev_event_id textNOT NULL

Indexes

  • (event_id) insertion_event_edges_event_id
  • (insertion_prev_event_id) insertion_event_edges_insertion_prev_event_id
  • (room_id) insertion_event_edges_insertion_room_id

Referenced by

  • nothing

insertion_event_extremities

2 cols · no RLS · line 469View in 3D
  • Isolated table — insertion_event_extremities references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id textNOT NULL
room_id textNOT NULL

Indexes

  • UNIQUE (event_id) insertion_event_extremities_event_id
  • (room_id) insertion_event_extremities_room_id

Referenced by

  • nothing

ex_outlier_stream

4 cols · no RLS · line 441View in 3D
  • Isolated table — ex_outlier_stream references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_stream_ordering PKbigintNOT NULL
event_id textNOT NULL
state_group bigintNOT NULL
instance_name textnull

Indexes

  • none

Referenced by

  • nothing

stream_ordering_to_exterm

3 cols · no RLS · line 826View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — stream_ordering_to_exterm references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
stream_ordering bigintNOT NULL
room_id textNOT NULL
event_id textNOT NULL

Indexes

  • (stream_ordering) stream_ordering_to_exterm_idx
  • (room_id, stream_ordering) stream_ordering_to_exterm_rm_idx

Referenced by

  • nothing

event_txn_id

6 cols · no RLS · line 402View in 3D
  • Foreign key without index token_id — PostgreSQL does not index FK columns automatically. Every DELETE/UPDATE on access_tokens must scan event_txn_id to check the constraint, and every join from the parent side is a sequential scan. The scan cost grows with the child table forever, so this gets worse on its own. An index is not free. Every write to event_txn_id maintains it — insert, update and delete alike — and it takes disk. Weigh that against how often access_tokens rows are actually deleted or re-keyed — if the answer is never, the scan never happens and the index only costs.
ColumnTypeNullDefaultReferencesNotes
event_id textNOT NULLevents.event_id 1:1 · CASCADE
room_id textNOT NULL
user_id textNOT NULL
token_id bigintNOT NULLaccess_tokens.id 1:N · CASCADE
txn_id textNOT NULL
inserted_ts bigintNOT NULL

Indexes

  • UNIQUE (event_id) event_txn_id_event_id
  • (inserted_ts) event_txn_id_ts
  • UNIQUE (room_id, user_id, token_id, txn_id) event_txn_id_txn_id

Referenced by

  • nothing

Room state 7 tables

Resolved room state: state groups and the edges between them, the state each group holds, and the current state of every room.

Entity-relationship diagram: state_groups, state_group_edges, state_groups_state, state_events, current_state_events, current_state_delta_stream, event_to_state_groupsstate_groupsid PKbigintroom_idtextevent_idtextstate_group_edgesstate_groupbigintprev_state_groupbigintstate_groups_statestate_groupbigintroom_idtexttypetextstate_keytextevent_idtextstate_eventsevent_idtextroom_idtexttypetextstate_keytextprev_statetextcurrent_state_eventsevent_idtextroom_idtexttypetextstate_keytextmembershiptextcurrent_state_delta_streamstream_idbigintroom_idtexttypetextstate_keytextevent_idtextprev_event_idtextinstance_nametextevent_to_state_groupsevent_idtextstate_groupbigint

Relationships

No foreign keys in this domain.

state_groups

3 cols · no RLS · line 1359View in 3D
  • Isolated table — state_groups references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
id PKbigintNOT NULL
room_id textNOT NULL
event_id textNOT NULL

Indexes

  • (room_id) state_groups_room_id_idx

Referenced by

  • nothing

state_group_edges

2 cols · no RLS · line 1349View in 3D

synapse/storage/schema/state/full_schemas/72/full.sql.postgres

  • Isolated table — state_group_edges references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
state_group bigintNOT NULL
prev_state_group bigintNOT NULL

Indexes

  • (prev_state_group) state_group_edges_prev_idx
  • UNIQUE (state_group, prev_state_group) state_group_edges_unique_idx

Referenced by

  • nothing

state_groups_state

5 cols · no RLS · line 1364View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Enum-like column with no CHECK type — type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — state_groups_state references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
state_group bigintNOT NULL
room_id textNOT NULL
type textNOT NULL
state_key textNOT NULL
event_id textNOT NULL

Indexes

  • (state_group, type, state_key) state_groups_state_type_idx

Referenced by

  • nothing

state_events

5 cols · no RLS · line 814View in 3D
  • Enum-like column with no CHECK type — type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Enum-like column with no CHECK prev_state — prev_state is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — state_events references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id UKtextNOT NULL
room_id textNOT NULL
type textNOT NULL
state_key textNOT NULL
prev_state textnull

Indexes

  • none

Referenced by

  • nothing

current_state_events

5 cols · no RLS · line 107View in 3D
  • Enum-like column with no CHECK type — type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — current_state_events references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id UKtextNOT NULL
room_id textNOT NULL
type textNOT NULL
state_key textNOT NULL
membership textnull

Indexes

  • (state_key) WHERE type = CAST('m.room.member' AS text) current_state_events_member_index

Referenced by

  • nothing

current_state_delta_stream

7 cols · no RLS · line 98View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Enum-like column with no CHECK type — type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — current_state_delta_stream references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
stream_id bigintNOT NULL
room_id textNOT NULL
type textNOT NULL
state_key textNOT NULL
event_id textnull
prev_event_id textnull
instance_name textnull

Indexes

  • (stream_id) current_state_delta_stream_idx

Referenced by

  • nothing

event_to_state_groups

2 cols · no RLS · line 398View in 3D
  • Isolated table — event_to_state_groups references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id UKtextNOT NULL
state_group bigintNOT NULL

Indexes

  • (state_group) event_to_state_groups_sg_index

Referenced by

  • nothing

Federation 10 tables

Talking to other homeservers: destinations and their retry state, received transactions, staged inbound events, remote server signing keys, and partial-state rooms during a fast join.

Entity-relationship diagram: destinations, destination_rooms, received_transactions, federation_inbound_events_staging, federation_stream_position, server_keys_json, server_signature_keys, partial_state_rooms, partial_state_rooms_servers, partial_state_eventsdestinationsdestination PKtextretry_last_tsbigintretry_intervalbigintfailure_tsbigintlast_successful_stream_orderingbigintdestination_roomsdestination PKtextroom_id PKtextstream_orderingbigintreceived_transactionstransaction_idtextorigintexttsbigintresponse_codeintegerresponse_jsonbyteahas_been_referencedsmallintfederation_inbound_events_stagingorigintextroom_idtextevent_idtextreceived_tsbigintevent_jsontextinternal_metadatatextfederation_stream_positiontypetextstream_idbigintinstance_nametextserver_keys_jsonserver_nametextkey_idtextfrom_servertextts_added_msbigintts_valid_until_msbigintkey_jsonbyteaserver_signature_keysserver_nametextkey_idtextfrom_servertextts_added_msbigintverify_keybyteats_valid_until_msbigintpartial_state_roomsroom_id PKtextpartial_state_rooms_serversroom_id FKtextserver_nametextpartial_state_eventsroom_id FKtextevent_id FKtexteventsroomsdestinationroom_idroom_idevent_idroom_idroom_id

Relationships

destinations

5 cols · no RLS · line 130View in 3D
ColumnTypeNullDefaultReferencesNotes
destination PKtextNOT NULL
retry_last_ts bigintnull
retry_interval bigintnull
failure_ts bigintnull
last_successful_stream_ordering bigintnull

Indexes

  • none

Referenced by

destination_rooms

3 cols · no RLS · line 125View in 3D
ColumnTypeNullDefaultReferencesNotes
destination PKtextNOT NULLdestinations.destination 1:N
room_id PKtextNOT NULLrooms.room_id 1:N
stream_ordering bigintNOT NULL

Indexes

  • (room_id) destination_rooms_room_id

Referenced by

  • nothing

received_transactions

6 cols · no RLS · line 652View in 3D
  • Isolated table — received_transactions references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
transaction_id textnull
origin textnull
ts bigintnull
response_code integernull
response_json byteanull
has_been_referenced smallintnull0

Indexes

  • (ts) received_transactions_ts

Referenced by

  • nothing

federation_inbound_events_staging

6 cols · no RLS · line 447View in 3D
  • Isolated table — federation_inbound_events_staging references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
origin textNOT NULL
room_id textNOT NULL
event_id textNOT NULL
received_ts bigintNOT NULL
event_json textNOT NULL
internal_metadata textNOT NULL

Indexes

  • UNIQUE (origin, event_id) federation_inbound_events_staging_instance_event
  • (room_id, received_ts) federation_inbound_events_staging_room

Referenced by

  • nothing

federation_stream_position

3 cols · no RLS · line 455View in 3D
  • Enum-like column with no CHECK type — type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — federation_stream_position references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
type textNOT NULL
stream_id bigintNOT NULL
instance_name textNOT NULLCAST('master' AS text)

Indexes

  • UNIQUE (type, instance_name) federation_stream_position_instance

Referenced by

  • nothing

server_keys_json

6 cols · no RLS · line 792View in 3D
  • Isolated table — server_keys_json references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
server_name textNOT NULL
key_id textNOT NULL
from_server textNOT NULL
ts_added_ms bigintNOT NULL
ts_valid_until_ms bigintNOT NULL
key_json byteaNOT NULL

Indexes

  • none

Referenced by

  • nothing

server_signature_keys

6 cols · no RLS · line 800View in 3D
  • Isolated table — server_signature_keys references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
server_name textnull
key_id textnull
from_server textnull
ts_added_ms bigintnull
verify_key byteanull
ts_valid_until_ms bigintnull

Indexes

  • none

Referenced by

  • nothing

partial_state_rooms

1 cols · no RLS · line 538View in 3D
ColumnTypeNullDefaultReferencesNotes
room_id PKtextNOT NULLrooms.room_id 1:1

Indexes

  • none

Referenced by

partial_state_rooms_servers

2 cols · no RLS · line 541View in 3D
ColumnTypeNullDefaultReferencesNotes
room_id textNOT NULLpartial_state_rooms.room_id 1:N
server_name textNOT NULL

Indexes

  • none

Referenced by

  • nothing

partial_state_events

2 cols · no RLS · line 534View in 3D
ColumnTypeNullDefaultReferencesNotes
room_id textNOT NULLpartial_state_rooms.room_id 1:N
event_id UKtextNOT NULLevents.event_id 1:1

Indexes

  • (room_id) partial_state_events_room_id_idx

Referenced by

  • nothing

Application services 4 tables

Bridges and bots: per-service transaction state and the rooms each service has claimed.

Entity-relationship diagram: application_services_state, application_services_txns, appservice_room_list, appservice_stream_positionapplication_services_stateas_id PKtextstatevarchar(5)read_receipt_stream_idbigintpresence_stream_idbigintto_device_stream_idbigintdevice_list_stream_idbigintapplication_services_txnsas_idtexttxn_idbigintevent_idstextappservice_room_listappservice_idtextnetwork_idtextroom_idtextappservice_stream_positionlockchar(1)stream_orderingbigint

Relationships

No foreign keys in this domain.

application_services_state

6 cols · no RLS · line 47View in 3D
  • Enum-like column with no CHECK state — state is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — application_services_state references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
as_id PKtextNOT NULL
state varchar(5)null
read_receipt_stream_id bigintnull
presence_stream_id bigintnull
to_device_stream_id bigintnull
device_list_stream_id bigintnull

Indexes

  • none

Referenced by

  • nothing

application_services_txns

3 cols · no RLS · line 61View in 3D
  • Isolated table — application_services_txns references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
as_id textNOT NULL
txn_id bigintNOT NULL
event_ids textNOT NULL

Indexes

  • (as_id) application_services_txns_id

Referenced by

  • nothing

appservice_room_list

3 cols · no RLS · line 66View in 3D
  • Isolated table — appservice_room_list references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
appservice_id textNOT NULL
network_id textNOT NULL
room_id textNOT NULL

Indexes

  • UNIQUE (appservice_id, network_id, room_id) appservice_room_list_idx

Referenced by

  • nothing

appservice_stream_position

2 cols · no RLS · line 71View in 3D
  • Isolated table — appservice_stream_position references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
lock UKchar(1)NOT NULLCAST('X' AS bpchar)CHECK lock = CAST('X' AS bpchar)
stream_ordering bigintnull

Indexes

  • none

Referenced by

  • nothing

Table checks: lock = CAST('X' AS bpchar)

Push notifications 11 tables

Registered pushers, the rules deciding what is worth notifying about, and the per-user unread and highlight counts kept alongside them.

Entity-relationship diagram: pushers, deleted_pushers, pusher_throttle, push_rules, push_rules_enable, push_rules_stream, event_push_actions, event_push_actions_staging, event_push_summary, event_push_summary_last_receipt_stream_id, event_push_summary_stream_orderingpushersid PKbigintuser_nametextaccess_tokenbigintprofile_tagtextkindtextapp_idtextapp_display_nametextdevice_display_nametextpushkeytexttsbigintlangtextdatatextlast_stream_orderingbigintlast_successbigintfailing_sincebigintdeleted_pushersstream_idbigintapp_idtextpushkeytextuser_idtextpusher_throttlepusher PKbigintroom_id PKtextlast_sent_tsbigintthrottle_msbigintpush_rulesid PKbigintuser_nametextrule_idtextpriority_classsmallintpriorityintegerconditionstextactionstextpush_rules_enableid PKbigintuser_nametextrule_idtextenabledsmallintpush_rules_streamstream_idbigintevent_stream_orderingbigintuser_idtextrule_idtextoptextpriority_classsmallintpriorityintegerconditionstextactionstextevent_push_actionsroom_idtextevent_idtextuser_idtextprofile_tagvarchar(32)actionstexttopological_orderingbigintstream_orderingbigintnotifsmallinthighlightsmallintunreadsmallintthread_idtextevent_push_actions_stagingevent_idtextuser_idtextactionstextnotifsmallinthighlightsmallintunreadsmallintthread_idtextevent_push_summaryuser_idtextroom_idtextnotif_countbigintstream_orderingbigintunread_countbigintlast_receipt_stream_orderingbigintthread_idtextevent_push_summary_last_receipt_stream_idlockchar(1)stream_idbigintevent_push_summary_stream_orderinglockchar(1)stream_orderingbigint

Relationships

No foreign keys in this domain.

pushers

15 cols · no RLS · line 605View in 3D
  • Enum-like column with no CHECK kind — kind is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — pushers references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
id PKbigintNOT NULL
user_name textNOT NULL
access_token bigintnull
profile_tag textNOT NULL
kind textNOT NULL
app_id textNOT NULL
app_display_name textNOT NULL
device_display_name textNOT NULL
pushkey textNOT NULL
ts bigintNOT NULL
lang textnull
data textnull
last_stream_ordering bigintnull
last_success bigintnull
failing_since bigintnull

Indexes

  • none

Referenced by

  • nothing

deleted_pushers

4 cols · no RLS · line 119View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — deleted_pushers references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
stream_id bigintNOT NULL
app_id textNOT NULL
pushkey textNOT NULL
user_id textNOT NULL

Indexes

  • (stream_id) deleted_pushers_stream_id

Referenced by

  • nothing

pusher_throttle

4 cols · no RLS · line 599View in 3D
  • Isolated table — pusher_throttle references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
pusher PKbigintNOT NULL
room_id PKtextNOT NULL
last_sent_ts bigintnull
throttle_ms bigintnull

Indexes

  • none

Referenced by

  • nothing

push_rules

7 cols · no RLS · line 573View in 3D
  • Isolated table — push_rules references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
id PKbigintNOT NULL
user_name textNOT NULL
rule_id textNOT NULL
priority_class smallintNOT NULL
priority integerNOT NULL0
conditions textNOT NULL
actions textNOT NULL

Indexes

  • (user_name) push_rules_user_name

Referenced by

  • nothing

push_rules_enable

4 cols · no RLS · line 582View in 3D
  • Isolated table — push_rules_enable references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
id PKbigintNOT NULL
user_name textNOT NULL
rule_id textNOT NULL
enabled smallintnull

Indexes

  • (user_name) push_rules_enable_user_name

Referenced by

  • nothing

push_rules_stream

9 cols · no RLS · line 588View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — push_rules_stream references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
stream_id bigintNOT NULL
event_stream_ordering bigintNOT NULL
user_id textNOT NULL
rule_id textNOT NULL
op textNOT NULL
priority_class smallintnull
priority integernull
conditions textnull
actions textnull

Indexes

  • (stream_id) push_rules_stream_id
  • (user_id, stream_id) push_rules_stream_user_stream_id

Referenced by

  • nothing

event_push_actions

11 cols · no RLS · line 333View in 3D
  • Isolated table — event_push_actions references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
room_id textNOT NULL
event_id textNOT NULL
user_id textNOT NULL
profile_tag varchar(32)null
actions textNOT NULL
topological_ordering bigintnull
stream_ordering bigintnull
notif smallintnull
highlight smallintnull
unread smallintnull
thread_id textnull

Indexes

  • (user_id, room_id, topological_ordering, stream_ordering) WHERE highlight = 1 event_push_actions_highlights_index
  • (user_id, room_id, topological_ordering, stream_ordering) event_push_actions_rm_tokens
  • (room_id, user_id) event_push_actions_room_id_user_id
  • (highlight, stream_ordering) WHERE highlight = 0 event_push_actions_stream_highlight_index
  • (stream_ordering, user_id) event_push_actions_stream_ordering
  • (user_id, stream_ordering) event_push_actions_u_highlight

Referenced by

  • nothing

event_push_actions_staging

7 cols · no RLS · line 346View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — event_push_actions_staging references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
event_id textNOT NULL
user_id textNOT NULL
actions textNOT NULL
notif smallintNOT NULL
highlight smallintNOT NULL
unread smallintnull
thread_id textnull

Indexes

  • (event_id) event_push_actions_staging_id

Referenced by

  • nothing

event_push_summary

7 cols · no RLS · line 355View in 3D
  • Isolated table — event_push_summary references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
room_id textNOT NULL
notif_count bigintNOT NULL
stream_ordering bigintNOT NULL
unread_count bigintnull
last_receipt_stream_ordering bigintnull
thread_id textnull

Indexes

  • UNIQUE (user_id, room_id) event_push_summary_unique_index
  • UNIQUE (user_id, room_id, thread_id) event_push_summary_unique_index2

Referenced by

  • nothing

event_push_summary_last_receipt_stream_id

2 cols · no RLS · line 364View in 3D
  • Isolated table — event_push_summary_last_receipt_stream_id references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
lock UKchar(1)NOT NULLCAST('X' AS bpchar)CHECK lock = CAST('X' AS bpchar)
stream_id bigintNOT NULL

Indexes

  • none

Referenced by

  • nothing

Table checks: lock = CAST('X' AS bpchar)

event_push_summary_stream_ordering

2 cols · no RLS · line 369View in 3D
  • Isolated table — event_push_summary_stream_ordering references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
lock UKchar(1)NOT NULLCAST('X' AS bpchar)CHECK lock = CAST('X' AS bpchar)
stream_ordering bigintNOT NULL

Indexes

  • none

Referenced by

  • nothing

Table checks: lock = CAST('X' AS bpchar)

Receipts and presence 5 tables

Read receipts in both graph and linearised form, and who is online.

Entity-relationship diagram: receipts_graph, receipts_linearized, presence, presence_stream, users_to_send_full_presence_toreceipts_graphroom_idtextreceipt_typetextuser_idtextevent_idstextdatatextthread_idtextreceipts_linearizedstream_idbigintroom_idtextreceipt_typetextuser_idtextevent_idtextdatatextinstance_nametextevent_stream_orderingbigintthread_idtextpresenceuser_idtextstatevarchar(20)status_msgtextmtimebigintpresence_streamstream_idbigintuser_idtextstatetextlast_active_tsbigintlast_federation_update_tsbigintlast_user_sync_tsbigintstatus_msgtextcurrently_activebooleaninstance_nametextusers_to_send_full_presence_touser_id PKtextpresence_stream_idbigintusersuser_id

Relationships

receipts_graph

6 cols · no RLS · line 627View in 3D
  • Enum-like column with no CHECK receipt_type — receipt_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — receipts_graph references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
room_id textNOT NULL
receipt_type textNOT NULL
user_id textNOT NULL
event_ids textNOT NULL
data textNOT NULL
thread_id textnull

Indexes

  • UNIQUE (room_id, receipt_type, user_id) WHERE thread_id IS NULL receipts_graph_unique_index

Referenced by

  • nothing

receipts_linearized

9 cols · no RLS · line 635View in 3D
  • Enum-like column with no CHECK receipt_type — receipt_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — receipts_linearized references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
stream_id bigintNOT NULL
room_id textNOT NULL
receipt_type textNOT NULL
user_id textNOT NULL
event_id textNOT NULL
data textNOT NULL
instance_name textnull
event_stream_ordering bigintnull
thread_id textnull

Indexes

  • (stream_id) receipts_linearized_id
  • (room_id, stream_id) receipts_linearized_room_stream
  • UNIQUE (room_id, receipt_type, user_id) WHERE thread_id IS NULL receipts_linearized_unique_index
  • (user_id) receipts_linearized_user

Referenced by

  • nothing

presence

4 cols · no RLS · line 545View in 3D
  • Enum-like column with no CHECK state — state is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — presence references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id UKtextNOT NULL
state varchar(20)null
status_msg textnull
mtime bigintnull

Indexes

  • none

Referenced by

  • nothing

presence_stream

9 cols · no RLS · line 551View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Enum-like column with no CHECK state — state is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — presence_stream references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
stream_id bigintnull
user_id textnull
state textnull
last_active_ts bigintnull
last_federation_update_ts bigintnull
last_user_sync_ts bigintnull
status_msg textnull
currently_active booleannull
instance_name textnull

Indexes

  • (stream_id, user_id) presence_stream_id
  • (state) WHERE state <> CAST('offline' AS text) presence_stream_state_not_offline_idx
  • (user_id) presence_stream_user_id

Referenced by

  • nothing

users_to_send_full_presence_to

2 cols · no RLS · line 965View in 3D
ColumnTypeNullDefaultReferencesNotes
user_id PKtextNOT NULLusers.name 1:1
presence_stream_id bigintnull

Indexes

  • none

Referenced by

  • nothing

Media repository 5 tables

Locally uploaded files and cached remote ones, their generated thumbnails, and the URL preview cache.

Entity-relationship diagram: local_media_repository, local_media_repository_thumbnails, local_media_repository_url_cache, remote_media_cache, remote_media_cache_thumbnailslocal_media_repositorymedia_idtextmedia_typetextmedia_lengthintegercreated_tsbigintupload_nametextuser_idtextquarantined_bytexturl_cachetextlast_access_tsbigintsafe_from_quarantinebooleanlocal_media_repository_thumbnailsmedia_idtextthumbnail_widthintegerthumbnail_heightintegerthumbnail_typetextthumbnail_methodtextthumbnail_lengthintegerlocal_media_repository_url_cacheurltextresponse_codeintegeretagtextexpires_tsbigintogtextmedia_idtextdownload_tsbigintremote_media_cachemedia_origintextmedia_idtextmedia_typetextcreated_tsbigintupload_nametextmedia_lengthintegerfilesystem_idtextlast_access_tsbigintquarantined_bytextremote_media_cache_thumbnailsmedia_origintextmedia_idtextthumbnail_widthintegerthumbnail_heightintegerthumbnail_methodtextthumbnail_typetextthumbnail_lengthintegerfilesystem_idtext

Relationships

No foreign keys in this domain.

local_media_repository

10 cols · no RLS · line 496View in 3D
  • Enum-like column with no CHECK media_type — media_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — local_media_repository references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
media_id UKtextnull
media_type textnull
media_length integernull
created_ts bigintnull
upload_name textnull
user_id textnull
quarantined_by textnull
url_cache textnull
last_access_ts bigintnull
safe_from_quarantine booleanNOT NULLFALSE

Indexes

  • (created_ts) WHERE url_cache IS NOT NULL local_media_repository_url_idx
  • (user_id, created_ts) users_have_local_media

Referenced by

  • nothing

local_media_repository_thumbnails

6 cols · no RLS · line 508View in 3D
  • Enum-like column with no CHECK thumbnail_type — thumbnail_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — local_media_repository_thumbnails references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
media_id textnull
thumbnail_width integernull
thumbnail_height integernull
thumbnail_type textnull
thumbnail_method textnull
thumbnail_length integernull

Indexes

  • UNIQUE (media_id, thumbnail_width, thumbnail_height, thumbnail_type, thumbnail_method) local_media_repository_thumbn_media_id_width_height_method_key
  • (media_id) local_media_repository_thumbnails_media_id

Referenced by

  • nothing

local_media_repository_url_cache

7 cols · no RLS · line 516View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — local_media_repository_url_cache references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
url textnull
response_code integernull
etag textnull
expires_ts bigintnull
og textnull
media_id textnull
download_ts bigintnull

Indexes

  • (url, download_ts) local_media_repository_url_cache_by_url_download_ts
  • (expires_ts) local_media_repository_url_cache_expires_idx
  • (media_id) local_media_repository_url_cache_media_idx

Referenced by

  • nothing

remote_media_cache

9 cols · no RLS · line 687View in 3D
  • Enum-like column with no CHECK media_type — media_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — remote_media_cache references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
media_origin textnull
media_id textnull
media_type textnull
created_ts bigintnull
upload_name textnull
media_length integernull
filesystem_id textnull
last_access_ts bigintnull
quarantined_by textnull

Indexes

  • none

Referenced by

  • nothing

remote_media_cache_thumbnails

8 cols · no RLS · line 698View in 3D
  • Enum-like column with no CHECK thumbnail_type — thumbnail_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — remote_media_cache_thumbnails references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
media_origin textnull
media_id textnull
thumbnail_width integernull
thumbnail_height integernull
thumbnail_method textnull
thumbnail_type textnull
thumbnail_length integernull
filesystem_id textnull

Indexes

  • UNIQUE (media_origin, media_id, thumbnail_width, thumbnail_height, thumbnail_type, thumbnail_method) remote_media_repository_thumbn_media_origin_id_width_height_met

Referenced by

  • nothing

User directory and statistics 13 tables

The searchable user directory, which users share rooms, and the rolled-up room and user statistics behind the admin views.

Entity-relationship diagram: user_directory, user_directory_search, user_directory_stream_pos, users_in_public_rooms, users_who_share_private_rooms, room_stats_current, room_stats_state, room_stats_earliest_token, user_stats_current, stats_incremental_position, user_daily_visits, monthly_active_users, user_ipsuser_directoryuser_idtextroom_idtextdisplay_nametextavatar_urltextuser_directory_searchuser_idtextvectortsvectoruser_directory_stream_poslockchar(1)stream_idbigintusers_in_public_roomsuser_idtextroom_idtextusers_who_share_private_roomsuser_idtextother_user_idtextroom_idtextroom_stats_currentroom_id PKtextcurrent_state_eventsintegerjoined_membersintegerinvited_membersintegerleft_membersintegerbanned_membersintegerlocal_users_in_roomintegercompleted_delta_stream_idbigintknocked_membersintegerroom_stats_stateroom_idtextnametextcanonical_aliastextjoin_rulestexthistory_visibilitytextencryptiontextavatartextguest_accesstextis_federatablebooleantopictextroom_typetextroom_stats_earliest_tokenroom_idtexttokenbigintuser_stats_currentuser_id PKtextjoined_roomsbigintcompleted_delta_stream_idbigintstats_incremental_positionlockchar(1)stream_idbigintuser_daily_visitsuser_idtextdevice_idtexttimestampbigintuser_agenttextmonthly_active_usersuser_idtexttimestampbigintuser_ipsuser_idtextaccess_tokentextdevice_idtextiptextuser_agenttextlast_seenbigint

Relationships

No foreign keys in this domain.

user_directory

4 cols · no RLS · line 881View in 3D
  • Isolated table — user_directory references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
room_id textnull
display_name textnull
avatar_url textnull

Indexes

  • (room_id) user_directory_room_idx
  • UNIQUE (user_id) user_directory_user_idx

Referenced by

  • nothing

user_directory_stream_pos

2 cols · no RLS · line 891View in 3D
  • Isolated table — user_directory_stream_pos references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
lock UKchar(1)NOT NULLCAST('X' AS bpchar)CHECK lock = CAST('X' AS bpchar)
stream_id bigintnull

Indexes

  • none

Referenced by

  • nothing

Table checks: lock = CAST('X' AS bpchar)

users_in_public_rooms

2 cols · no RLS · line 958View in 3D
  • Isolated table — users_in_public_rooms references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
room_id textNOT NULL

Indexes

  • (room_id) users_in_public_rooms_r_idx
  • UNIQUE (user_id, room_id) users_in_public_rooms_u_idx

Referenced by

  • nothing

users_who_share_private_rooms

3 cols · no RLS · line 969View in 3D
  • Isolated table — users_who_share_private_rooms references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
other_user_id textNOT NULL
room_id textNOT NULL

Indexes

  • (other_user_id) users_who_share_private_rooms_o_idx
  • (room_id) users_who_share_private_rooms_r_idx
  • UNIQUE (user_id, other_user_id, room_id) users_who_share_private_rooms_u_idx

Referenced by

  • nothing

room_stats_current

9 cols · no RLS · line 745View in 3D
  • Isolated table — room_stats_current references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
room_id PKtextNOT NULL
current_state_events integerNOT NULL
joined_members integerNOT NULL
invited_members integerNOT NULL
left_members integerNOT NULL
banned_members integerNOT NULL
local_users_in_room integerNOT NULL
completed_delta_stream_id bigintNOT NULL
knocked_members integernull

Indexes

  • none

Referenced by

  • nothing

room_stats_state

11 cols · no RLS · line 760View in 3D
  • Enum-like column with no CHECK history_visibility — history_visibility is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Enum-like column with no CHECK room_type — room_type is a short string that clearly takes a fixed set of values, but the database accepts anything. Typos become new states, and nobody can list the legal values without reading application code.
  • Isolated table — room_stats_state references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
room_id textNOT NULL
name textnull
canonical_alias textnull
join_rules textnull
history_visibility textnull
encryption textnull
avatar textnull
guest_access textnull
is_federatable booleannull
topic textnull
room_type textnull

Indexes

  • UNIQUE (room_id) room_stats_state_room

Referenced by

  • nothing

room_stats_earliest_token

2 cols · no RLS · line 756View in 3D
  • Isolated table — room_stats_earliest_token references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
room_id textNOT NULL
token bigintNOT NULL

Indexes

  • UNIQUE (room_id) room_stats_earliest_token_idx

Referenced by

  • nothing

user_stats_current

3 cols · no RLS · line 925View in 3D
  • Isolated table — user_stats_current references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id PKtextNOT NULL
joined_rooms bigintNOT NULL
completed_delta_stream_id bigintNOT NULL

Indexes

  • none

Referenced by

  • nothing

stats_incremental_position

2 cols · no RLS · line 821View in 3D
  • Isolated table — stats_incremental_position references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
lock UKchar(1)NOT NULLCAST('X' AS bpchar)CHECK lock = CAST('X' AS bpchar)
stream_id bigintNOT NULL

Indexes

  • none

Referenced by

  • nothing

Table checks: lock = CAST('X' AS bpchar)

user_daily_visits

4 cols · no RLS · line 875View in 3D
  • No primary key — Without a primary key rows are not individually addressable: no safe UPDATE/DELETE of one row, no logical replication, ORMs misbehave, and duplicates are legal.
  • Isolated table — user_daily_visits references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
device_id textnull
timestamp bigintNOT NULL
user_agent textnull

Indexes

  • (timestamp) user_daily_visits_ts_idx
  • (user_id, timestamp) user_daily_visits_uts_idx

Referenced by

  • nothing

monthly_active_users

2 cols · no RLS · line 525View in 3D
  • Isolated table — monthly_active_users references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
timestamp bigintNOT NULL

Indexes

  • (timestamp) monthly_active_users_time_stamp
  • UNIQUE (user_id) monthly_active_users_users

Referenced by

  • nothing

user_ips

6 cols · no RLS · line 912View in 3D
  • Isolated table — user_ips references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
access_token textNOT NULL
device_id textnull
ip textNOT NULL
user_agent textNOT NULL
last_seen bigintNOT NULL

Indexes

  • (user_id, device_id, last_seen) user_ips_device_id
  • (user_id, last_seen) user_ips_last_seen
  • (last_seen) user_ips_last_seen_only
  • UNIQUE (user_id, access_token, ip) user_ips_user_token_ip_unique_index

Referenced by

  • nothing

Worker coordination 5 tables

How the processes that make up one homeserver stay in step: worker locks, the instance map, stream positions and cache invalidation, plus per-user rate-limit overrides.

Entity-relationship diagram: worker_locks, instance_map, stream_positions, cache_invalidation_stream_by_instance, ratelimit_overrideworker_lockslock_nametextlock_keytextinstance_nametexttokentextlast_renewed_tsbigintinstance_mapinstance_id PKintegerinstance_nametextstream_positionsstream_nametextinstance_nametextstream_idbigintcache_invalidation_stream_by_instancestream_idbigintinstance_nametextcache_functextkeystext[]invalidation_tsbigintratelimit_overrideuser_idtextmessages_per_secondbigintburst_countbigint

Relationships

No foreign keys in this domain.

worker_locks

5 cols · no RLS · line 974View in 3D
  • Isolated table — worker_locks references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
lock_name textNOT NULL
lock_key textNOT NULL
instance_name textNOT NULL
token textNOT NULL
last_renewed_ts bigintNOT NULL

Indexes

  • UNIQUE (lock_name, lock_key) worker_locks_key

Referenced by

  • nothing

instance_map

2 cols · no RLS · line 478View in 3D
  • Isolated table — instance_map references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
instance_id PKintegerNOT NULL
instance_name textNOT NULL

Indexes

  • UNIQUE (instance_name) instance_map_idx

Referenced by

  • nothing

stream_positions

3 cols · no RLS · line 831View in 3D
  • Isolated table — stream_positions references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
stream_name textNOT NULL
instance_name textNOT NULL
stream_id bigintNOT NULL

Indexes

  • UNIQUE (stream_name, instance_name) stream_positions_idx

Referenced by

  • nothing

cache_invalidation_stream_by_instance

5 cols · no RLS · line 85View in 3D
  • Isolated table — cache_invalidation_stream_by_instance references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
stream_id bigintNOT NULL
instance_name textNOT NULL
cache_func textNOT NULL
keys text[]null
invalidation_ts bigintnull

Indexes

  • UNIQUE (stream_id) cache_invalidation_stream_by_instance_id
  • (instance_name, stream_id) cache_invalidation_stream_by_instance_instance_index

Referenced by

  • nothing

ratelimit_override

3 cols · no RLS · line 622View in 3D
  • Isolated table — ratelimit_override references nothing and nothing references it. Either it is a staging/log table (fine, say so), or it is dead, or it is the seed of a second data model growing beside the first.
ColumnTypeNullDefaultReferencesNotes
user_id textNOT NULL
messages_per_second bigintnull
burst_count bigintnull

Indexes

  • UNIQUE (user_id) ratelimit_override_idx

Referenced by

  • nothing