fix: Readd tokens.foreign_id column (#6038)

Otherwise backups exported from the current core and imported in versions < 1.144.0 have QR codes
not working. The breaking change which removed the column is
5a6efdff44.
This commit is contained in:
iequidoo
2024-10-12 15:47:39 -03:00
committed by iequidoo
parent 8f41aed917
commit 3c03370589

View File

@@ -1037,6 +1037,15 @@ CREATE INDEX msgs_status_updates_index2 ON msgs_status_updates (uid);
.await?;
}
inc_and_check(&mut migration_version, 122)?;
if dbversion < migration_version {
sql.execute_migration(
"ALTER TABLE tokens ADD COLUMN foreign_id INTEGER NOT NULL DEFAULT 0",
migration_version,
)
.await?;
}
let new_version = sql
.get_raw_config_int(VERSION_CFG)
.await?