feat(schema): rename canonical_pair_id to federated_id, add group DM columns

Renames dm_channels.canonical_pair_id → federated_id and adds
owner_home_user_id, owner_home_instance, deleted_at columns to support
federated group DMs. Migration handles upgrade from existing installs
(full table rebuild to rename), partial states (ALTER TABLE), and fresh
installs (correct DDL from the start). Backfills federated_id for
existing 1-on-1 DM channels and owner federation identity for group DMs.
This commit is contained in:
Jannis Braun
2026-03-26 19:59:44 +01:00
parent 742d851aae
commit d9dc33bd36
3 changed files with 135 additions and 17 deletions
+4 -1
View File
@@ -117,7 +117,10 @@ export const embeds = sqliteTable('embeds', {
export const dmChannels = sqliteTable('dm_channels', {
id: text('id').primaryKey(),
ownerId: text('owner_id'),
canonicalPairId: text('canonical_pair_id'),
federatedId: text('federated_id'),
ownerHomeUserId: text('owner_home_user_id'),
ownerHomeInstance: text('owner_home_instance'),
deletedAt: integer('deleted_at'),
createdAt: integer('created_at').notNull(),
});