feat: Kill roomsynctoken_shortstatehash dead

This commit is contained in:
Ginger committed 2026-07-09 16:43:10 -04:00
1 parent 62730e861a
commit 89dcda4c3c
3 files changed
+32 -2

No files matched your search

+24
View File
@@ -240,6 +240,19 @@ async fn migrate(services: &Services) -> Result<()> {
.map_err(|e| err!("Failed to run 'split_userid_password' migration': {e}"))?;
}
if db["global"]
.get(DROP_ROOMSYNCTOKEN_SHORTSTATEHASH)
.await
.is_not_found()
{
info!("Running migration 'drop_roomsynctoken_shortstatehash'");
obliterate_roomsynctoken_shortstatehash_with_extreme_prejudice(services)
.await
.map_err(|e| {
err!("Failed to run 'drop_roomsynctoken_shortstatehash' migration': {e}")
})?;
}
assert_eq!(
services.globals.db.database_version().await,
DATABASE_VERSION,
@@ -873,3 +886,14 @@ async fn split_userid_password(services: &Services) -> Result {
db.db.sort()?;
Ok(())
}
const DROP_ROOMSYNCTOKEN_SHORTSTATEHASH: &str = "drop_roomsynctoken_shortstatehash";
async fn obliterate_roomsynctoken_shortstatehash_with_extreme_prejudice(
services: &Services,
) -> Result {
services.db.db.drop_column("roomsynctoken_shortstatehash")?;
info!("Cleared roomsynctoken_shortstatehash.");
Ok(())
}