Add version rollback support for AppImage updates
This commit is contained in:
@@ -1744,6 +1744,24 @@ impl Database {
|
||||
Ok(self.conn.last_insert_rowid())
|
||||
}
|
||||
|
||||
// --- Version rollback ---
|
||||
|
||||
pub fn set_previous_version(&self, id: i64, path: Option<&str>) -> SqlResult<()> {
|
||||
self.conn.execute(
|
||||
"UPDATE appimages SET previous_version_path = ?2 WHERE id = ?1",
|
||||
params![id, path],
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn get_previous_version(&self, id: i64) -> SqlResult<Option<String>> {
|
||||
self.conn.query_row(
|
||||
"SELECT previous_version_path FROM appimages WHERE id = ?1",
|
||||
params![id],
|
||||
|row| row.get(0),
|
||||
)
|
||||
}
|
||||
|
||||
// --- System modification tracking ---
|
||||
|
||||
pub fn register_modification(
|
||||
|
||||
Reference in New Issue
Block a user