feat: Get rid of MessageState::{OutPreparing, OutMdnRcvd} in the db

`OutPreparing` is deprecated since 2024-12-07, replace it with `OutDraft` to let the user review
such messages if any. `OutMdnRcvd` is not used in the db for new messages since
a30c6ae1f7, `OutDelivered` is stored instead.
This commit is contained in:
iequidoo
2026-04-14 08:36:04 -03:00
parent 4d537544ef
commit 0b78fbaf74
9 changed files with 21 additions and 64 deletions

View File

@@ -2373,6 +2373,18 @@ ALTER TABLE contacts ADD COLUMN name_normalized TEXT;
.await?;
}
inc_and_check(&mut migration_version, 152)?;
if dbversion < migration_version {
sql.execute_migration(
"
UPDATE msgs SET state=26 WHERE state=28; -- Change OutMdnRcvd to OutDelivered.
UPDATE msgs SET state=19 WHERE state=18; -- Change OutPreparing to OutDraft.
",
migration_version,
)
.await?;
}
let new_version = sql
.get_raw_config_int(VERSION_CFG)
.await?