mattermost-mobile-upstream/app/database/schema/server/table_schemas
Guillermo Vayá 354e956f43 feat(drafts): Phase 1 synchronized-drafts storage foundation
Adds the durable storage foundation for synchronized drafts (mobile-only,
no network behavior yet):

- Fix draft batch dedup in handleDraft to key by the composite
  (channel_id, root_id) instead of channel_id alone, so a channel draft
  and its thread reply drafts in the same batch no longer collapse.
- Add Draft columns: server_update_at (nullable ancestry hint, not a
  revision), props (JSON), file_ids (JSON portable server attachment IDs).
- Add the DraftOutbox table (one durable pending op per draft key) with
  operation/status const objects, generation, keep_local, retry fields,
  and a deleted_fingerprint column for delete-vs-newer-write disambiguation.
- Add buildDraftOutboxId, the serialized mutateDraftAndOutbox writer
  primitive (enters database.write before querying both tables, commits one
  batch), and deterministic repairDuplicateDrafts.
- Bump server schema 20 -> 21 with addColumns + createTable migration;
  register schema/model in the database managers, mocks, types, and docs.

Tests: composite-key survival, concurrent-mutation serialization, batch
failure atomicity, duplicate repair winner, model round-trip / migration
compatibility, and migration definition.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 16:18:48 +02:00
..
category_channel.ts [Gekidou] Sidebar Categories (Database only) (#5909) 2022-01-31 10:30:10 -03:00
category.ts Gekidou - Updated Server Database Diagrams/Schema/Models (#6119) 2022-04-07 10:14:28 -04:00
channel_bookmark.ts Channel Bookmarks (#7817) 2024-07-18 09:10:28 +08:00
channel_info.ts add files count column in channel info table and db migration 2023-03-22 15:36:57 +05:30
channel_membership.ts [Gekidou] Update database to hold if a user is a team or channel admin (#6351) 2022-06-06 05:54:02 -04:00
channel.ts Database changes for autotranslations (#9495) 2026-02-10 15:04:35 +01:00
config.ts Move config to its own database table (#6744) 2022-11-11 21:20:42 +04:00
custom_emoji.ts Gekidou - Updated Server Database Diagrams/Schema/Models (#6119) 2022-04-07 10:14:28 -04:00
custom_profile_attribute.ts [MM-62565] DB only custom profile attributes and fields (#8739) 2025-04-09 15:35:27 +02:00
custom_profile_field.ts [MM-62565] DB only custom profile attributes and fields (#8739) 2025-04-09 15:35:27 +02:00
draft_outbox.ts feat(drafts): Phase 1 synchronized-drafts storage foundation 2026-07-23 16:18:48 +02:00
draft.ts feat(drafts): Phase 1 synchronized-drafts storage foundation 2026-07-23 16:18:48 +02:00
file.ts Add is_blocked to FileModel (#8842) 2025-05-07 15:33:04 +08:00
group_channel.ts [Gekidou] Groups + group membership schema (#6251) 2022-05-19 17:54:39 +10:00
group_membership.ts [Gekidou] Groups + group membership schema (#6251) 2022-05-19 17:54:39 +10:00
group_team.ts [Gekidou] Groups + group membership schema (#6251) 2022-05-19 17:54:39 +10:00
group.ts [Gekidou] [Migration] Adds member_count to groups table (#6468) 2022-07-15 11:01:54 +04:00
index.ts feat(drafts): Phase 1 synchronized-drafts storage foundation 2026-07-23 16:18:48 +02:00
my_channel_settings.ts [Gekidou] fix database schema and models (#5553) 2021-07-20 23:24:42 +04:00
my_channel.ts Database changes for autotranslations (#9495) 2026-02-10 15:04:35 +01:00
my_team.ts Remove team unreads and rely on channel member instead (#5710) 2021-10-01 16:07:57 -03:00
post.ts Add Index to 'type' column in 'Post' table (#8278) 2024-10-26 14:14:56 +02:00
posts_in_channel.ts [Gekidou] Allow multiple posts in thread and posts in channel for a specific root or channel (#5594) 2021-08-04 15:43:25 -04:00
posts_in_thread.ts Gekidou - Updated Server Database Diagrams/Schema/Models (#6119) 2022-04-07 10:14:28 -04:00
preference.ts MM-30482 [Gekidou] Data Operator (#5346) 2021-04-22 19:16:00 +04:00
property_field.ts Add BoardView, PropertyField, PropertyValue WatermelonDB tables (#9708) 2026-06-01 12:46:40 +02:00
property_value.ts Add BoardView, PropertyField, PropertyValue WatermelonDB tables (#9708) 2026-06-01 12:46:40 +02:00
reaction.ts Gekidou - Updated Server Database Diagrams/Schema/Models (#6119) 2022-04-07 10:14:28 -04:00
role.ts Gekidou - Updated Server Database Diagrams/Schema/Models (#6119) 2022-04-07 10:14:28 -04:00
scheduled_post.ts BoR scheduled posts and drafts DB migrations (#9352) 2025-12-18 11:26:24 +05:30
system.ts MM_36721 : Restructure Entities - Global & System (#5504) 2021-07-02 05:08:12 -04:00
team_channel_history.ts [Gekidou] fix database schema and models (#5553) 2021-07-20 23:24:42 +04:00
team_membership.ts [Gekidou] Update database to hold if a user is a team or channel admin (#6351) 2022-06-06 05:54:02 -04:00
team_search_history.ts Gekidou - Updated Server Database Diagrams/Schema/Models (#6119) 2022-04-07 10:14:28 -04:00
team_threads_sync.ts [MM-48375 Gekidou] Threads Sync Fix (#6788) 2022-12-01 21:38:27 +05:30
team.ts MM-39720_Invite People - phase 1 2022-10-31 18:12:03 -05:00
thread_in_team.ts [MM-48375 Gekidou] Threads Sync Fix (#6788) 2022-12-01 21:38:27 +05:30
thread_participant.ts [MM-48375 Gekidou] Threads Sync Fix (#6788) 2022-12-01 21:38:27 +05:30
thread.ts [MM-48375 Gekidou] Threads Sync Fix (#6788) 2022-12-01 21:38:27 +05:30
user.ts Add terms of service (#6777) 2022-11-24 19:58:56 +01:00