mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +03:00
Use sql migration over direct tables.sql modification
This commit is contained in:
@@ -10,7 +10,7 @@ use crate::provider::get_provider_by_domain;
|
||||
use crate::sql::Sql;
|
||||
use crate::tools::EmailAddress;
|
||||
|
||||
const DBVERSION: i32 = 68;
|
||||
const DBVERSION: i32 = 69;
|
||||
const VERSION_CFG: &str = "dbversion";
|
||||
const TABLES: &str = include_str!("./tables.sql");
|
||||
|
||||
@@ -616,6 +616,15 @@ CREATE INDEX smtp_messageid ON imap(rfc724_mid);
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
if dbversion < 94 {
|
||||
sql.execute_migration(
|
||||
r#"
|
||||
ALTER TABLE chats ADD COLUMN encryption_modus INTEGER DEFAULT 0;
|
||||
ALTER TABLE msgs ADD COLUMN encryption_modus INTEGER DEFAULT 0;"#,
|
||||
94,
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
|
||||
let new_version = sql
|
||||
.get_raw_config_int(VERSION_CFG)
|
||||
|
||||
@@ -38,8 +38,7 @@ CREATE TABLE chats (
|
||||
locations_last_sent INTEGER DEFAULT 0,
|
||||
created_timestamp INTEGER DEFAULT 0,
|
||||
muted_until INTEGER DEFAULT 0,
|
||||
ephemeral_timer INTEGER,
|
||||
encryption_modus INTEGER DEFAULT 0
|
||||
ephemeral_timer INTEGER
|
||||
);
|
||||
CREATE INDEX chats_index1 ON chats (grpid);
|
||||
CREATE INDEX chats_index2 ON chats (archived);
|
||||
@@ -93,8 +92,7 @@ CREATE TABLE msgs (
|
||||
-- deleted. It is convenient to store it here because UI
|
||||
-- needs this value to display how much time is left until
|
||||
-- the message is deleted.
|
||||
ephemeral_timestamp INTEGER DEFAULT 0,
|
||||
encryption_modus INTEGER DEFAULT 0
|
||||
ephemeral_timestamp INTEGER DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE INDEX msgs_index1 ON msgs (rfc724_mid);
|
||||
|
||||
Reference in New Issue
Block a user