[WIP] feat: Track when we last received a message from which contact via which relay

This commit is contained in:
Hocuri
2026-08-11 11:11:34 +02:00
parent c3563f73e4
commit 4937e0cd4f
+16
View File
@@ -2610,6 +2610,22 @@ UPDATE msgs SET state=24 WHERE state=18; -- Change OutPreparing to OutFailed.
.await?;
}
inc_and_check(&mut migration_version, 164)?;
if dbversion < migration_version {
sql.execute_migration(
"CREATE TABLE transport_usage(
contact_id INTEGER NOT NULL,
transport_id INTEGER NOT NULL,
last_seen INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY(contact_id, transport_id),
FOREIGN KEY(contact_id) REFERENCES contacts(id) ON DELETE CASCADE,
FOREIGN KEY(transport_id) REFERENCES transports(id) ON DELETE CASCADE
) STRICT",
migration_version,
)
.await?;
}
let new_version = sql
.get_raw_config_int(VERSION_CFG)
.await?