From d0d282de34e77263129770ab28b8ec97d115ba72 Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Wed, 4 Jan 2023 13:41:27 +0100 Subject: started version implementation --- src/db.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/db.rs') diff --git a/src/db.rs b/src/db.rs index 3f05772..d823018 100644 --- a/src/db.rs +++ b/src/db.rs @@ -32,7 +32,6 @@ pub fn mods_get_all_ids(config: Cfg) -> Result, Box Result Result Result Result<(), Box> { + let data = devdir(format!("{}/data.db", config.data).as_str()); + let connection = Connection::open(data).unwrap(); + + connection.execute("UPDATE lists SET mc_version = ? WHERE id = ?", [version, list_id])?; + Ok(()) +} + pub fn lists_get_all_ids(config: Cfg) -> Result, Box> { let data = devdir(format!("{}/data.db", config.data).as_str()); let connection = Connection::open(data).unwrap(); @@ -510,7 +515,7 @@ pub fn db_setup(config: Cfg) -> Result<(), Box> { "CREATE TABLE 'user_config' ( 'id' TEXT, 'value' TEXT ); CREATE TABLE 'mods' ( 'id' TEXT, 'name' TEXT, 'versions' TEXT ); CREATE TABLE 'lists' ( 'id' TEXT, 'mc_version' TEXT, 'modloader' TEXT, 'download_folder' TEXT ); - INSERT INTO 'user_config' VALUES ( 'db_version', '0.3' ); + INSERT INTO 'user_config' VALUES ( 'db_version', '0.4' ); INSERT INTO 'user_config' VALUES ( 'current_list', '...' )", )?; -- cgit v1.2.3