mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 13:36:30 +03:00
Add autodelete timer columns to message table
This commit is contained in:
19
src/sql.rs
19
src/sql.rs
@@ -910,6 +910,25 @@ fn open(
|
||||
)?;
|
||||
sql.set_raw_config_int(context, "dbversion", 64)?;
|
||||
}
|
||||
if dbversion < 65 {
|
||||
info!(context, "[migration] v65");
|
||||
// Timer value in seconds. For incoming messages this
|
||||
// timer starts when message is read, so we want to have
|
||||
// the value stored here until the timer starts.
|
||||
sql.execute(
|
||||
"ALTER TABLE msgs ADD COLUMN autodelete_timer INTEGER;",
|
||||
NO_PARAMS,
|
||||
)?;
|
||||
// Timestamp indicating when the message should be
|
||||
// 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.
|
||||
sql.execute(
|
||||
"ALTER TABLE msgs ADD COLUMN autodelete_timestamp INTEGER;",
|
||||
NO_PARAMS,
|
||||
)?;
|
||||
sql.set_raw_config_int(context, "dbversion", 65)?;
|
||||
}
|
||||
|
||||
// (2) updates that require high-level objects
|
||||
// (the structure is complete now and all objects are usable)
|
||||
|
||||
Reference in New Issue
Block a user