mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 04:46:29 +03:00
fix: reset options not available for chatmail on chatmail profiles
This commit is contained in:
@@ -1466,6 +1466,37 @@ ALTER TABLE contacts ADD COLUMN name_normalized TEXT;
|
|||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inc_and_check(&mut migration_version, 144)?;
|
||||||
|
if dbversion < migration_version {
|
||||||
|
sql.execute_migration_transaction(
|
||||||
|
|transaction| {
|
||||||
|
let is_chatmail = transaction
|
||||||
|
.query_row(
|
||||||
|
"SELECT value FROM config WHERE keyname='is_chatmail'",
|
||||||
|
(),
|
||||||
|
|row| {
|
||||||
|
let value: String = row.get(0)?;
|
||||||
|
Ok(value)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.optional()?
|
||||||
|
.as_deref()
|
||||||
|
== Some("1");
|
||||||
|
|
||||||
|
if is_chatmail {
|
||||||
|
transaction.execute_batch(
|
||||||
|
"DELETE FROM config WHERE keyname='only_fetch_mvbox';
|
||||||
|
DELETE FROM config WHERE keyname='show_emails';
|
||||||
|
UPDATE config SET value='0' WHERE keyname='mvbox_move'",
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
migration_version,
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
}
|
||||||
|
|
||||||
let new_version = sql
|
let new_version = sql
|
||||||
.get_raw_config_int(VERSION_CFG)
|
.get_raw_config_int(VERSION_CFG)
|
||||||
.await?
|
.await?
|
||||||
|
|||||||
Reference in New Issue
Block a user