Skip to content

Commit 24e18c1

Browse files
committed
fix: Delete obsolete "configured*" keys from config table (#7171)
1 parent 3eb1a7d commit 24e18c1

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

src/context.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,6 @@ impl Context {
818818
let unblocked_msgs = message::get_unblocked_msg_cnt(self).await;
819819
let request_msgs = message::get_request_msg_cnt(self).await;
820820
let contacts = Contact::get_real_cnt(self).await?;
821-
let is_configured = self.get_config_int(Config::Configured).await?;
822821
let proxy_enabled = self.get_config_int(Config::ProxyEnabled).await?;
823822
let dbversion = self
824823
.sql
@@ -897,7 +896,6 @@ impl Context {
897896
.await?
898897
.unwrap_or_else(|| "<unset>".to_string()),
899898
);
900-
res.insert("is_configured", is_configured.to_string());
901899
res.insert("proxy_enabled", proxy_enabled.to_string());
902900
res.insert("entered_account_settings", l.to_string());
903901
res.insert("used_account_settings", l2);

src/sql/migrations.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,32 @@ CREATE INDEX gossip_timestamp_index ON gossip_timestamp (chat_id, fingerprint);
13101310
.await?;
13111311
}
13121312

1313+
inc_and_check(&mut migration_version, 137)?;
1314+
if dbversion < migration_version {
1315+
sql.execute_migration(
1316+
"DELETE FROM config WHERE keyname IN (
1317+
'configured',
1318+
'configured_imap_certificate_checks',
1319+
'configured_imap_servers',
1320+
'configured_mail_port',
1321+
'configured_mail_pw',
1322+
'configured_mail_security',
1323+
'configured_mail_server',
1324+
'configured_mail_user',
1325+
'configured_send_port',
1326+
'configured_send_pw',
1327+
'configured_send_security',
1328+
'configured_send_server',
1329+
'configured_send_user',
1330+
'configured_server_flags',
1331+
'configured_smtp_certificate_checks',
1332+
'configured_smtp_servers'
1333+
)",
1334+
migration_version,
1335+
)
1336+
.await?;
1337+
}
1338+
13131339
let new_version = sql
13141340
.get_raw_config_int(VERSION_CFG)
13151341
.await?

0 commit comments

Comments
 (0)