mirror of
https://github.com/chatmail/core.git
synced 2026-04-18 22:16:30 +03:00
do not change db schema in an incompatible way (#5254)
PR #5099 removed some columns in the database that were actually in use. usually, to not worsen UX unnecessarily (releases take time - in between, "Add Second Device", "Backup" etc. would fail), we try to avoid such schema changes (checking for db-version would avoid import etc. but would still worse UX), see discussion at #2294. these are the errors, the user will be confronted with otherwise: <img width=400 src=https://github.com/deltachat/deltachat-core-rust/assets/9800740/e3f0fd6e-a7a9-43f6-9023-0ae003985425> it is not great to maintain the old columns, but well :) as no official releases with newer cores are rolled out yet, i think, it is fine to change the "107" migration and not copy things a second time in a newer migration. (this issue happens to me during testing, and is probably also the issue reported by @lk108 for ubuntu-touch)
This commit is contained in:
@@ -900,6 +900,17 @@ CREATE INDEX msgs_status_updates_index2 ON msgs_status_updates (uid);
|
||||
.await?;
|
||||
}
|
||||
|
||||
if dbversion < 110 {
|
||||
sql.execute_migration(
|
||||
"ALTER TABLE keypairs ADD COLUMN addr TEXT DEFAULT '' COLLATE NOCASE;
|
||||
ALTER TABLE keypairs ADD COLUMN is_default INTEGER DEFAULT 0;
|
||||
ALTER TABLE keypairs ADD COLUMN created INTEGER DEFAULT 0;
|
||||
UPDATE keypairs SET addr=(SELECT value FROM config WHERE keyname='configured_addr'), is_default=1;",
|
||||
110,
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
|
||||
let new_version = sql
|
||||
.get_raw_config_int(VERSION_CFG)
|
||||
.await?
|
||||
|
||||
Reference in New Issue
Block a user