diff --git a/src/sql.rs b/src/sql.rs index 1bcc19679..86d94e062 100644 --- a/src/sql.rs +++ b/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)