fix(migrate): move ownerId fix before federated_id backfill
The federated_id backfill queries WHERE owner_id IS NULL. If the ownerId fix runs after it, broken 1-on-1 DMs would be skipped.
This commit is contained in:
@@ -497,6 +497,9 @@ export function runMigrations(db: Database.Database): void {
|
|||||||
// ─── Rename canonical_pair_id → federated_id, add group DM columns ───────
|
// ─── Rename canonical_pair_id → federated_id, add group DM columns ───────
|
||||||
migrateDmChannelsFederatedId(db);
|
migrateDmChannelsFederatedId(db);
|
||||||
|
|
||||||
|
// ─── Fix ownerId on 1-on-1 DMs (must run before federated_id backfill) ──
|
||||||
|
migrateFixOneOnOneOwnerIds(db);
|
||||||
|
|
||||||
// ─── Backfill federated_id for existing 1-on-1 DM channels ──────────────
|
// ─── Backfill federated_id for existing 1-on-1 DM channels ──────────────
|
||||||
// (Runs after migrateDmChannelsFederatedId so the federated_id column is guaranteed to exist)
|
// (Runs after migrateDmChannelsFederatedId so the federated_id column is guaranteed to exist)
|
||||||
try {
|
try {
|
||||||
@@ -607,8 +610,6 @@ export function runMigrations(db: Database.Database): void {
|
|||||||
console.error('Federation mutation log backfill failed (non-fatal):', err);
|
console.error('Federation mutation log backfill failed (non-fatal):', err);
|
||||||
}
|
}
|
||||||
|
|
||||||
migrateFixOneOnOneOwnerIds(db);
|
|
||||||
|
|
||||||
console.log('Migrations complete.');
|
console.log('Migrations complete.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user