From 3c03370589a88425f89270a286296c89ae9a78bc Mon Sep 17 00:00:00 2001 From: iequidoo Date: Sat, 12 Oct 2024 15:47:39 -0300 Subject: [PATCH] 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 5a6efdff44b1d374ea0752ac394423ba258c134b. --- src/sql/migrations.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/sql/migrations.rs b/src/sql/migrations.rs index e9146ae2c..10ce2f4e1 100644 --- a/src/sql/migrations.rs +++ b/src/sql/migrations.rs @@ -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?