From afd9bc31349d50acdcb30b04070dac49bab514f7 Mon Sep 17 00:00:00 2001 From: yggverse Date: Wed, 2 Oct 2024 15:39:51 +0300 Subject: [PATCH] use internal db version --- src/app.rs | 2 +- src/app/database.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app.rs b/src/app.rs index 4692f323..5e5fae48 100644 --- a/src/app.rs +++ b/src/app.rs @@ -47,7 +47,7 @@ impl App { }; // Init database model - let database = Arc::new(Database::init(connection, env!("CARGO_PKG_VERSION"))); + let database = Arc::new(Database::init(connection)); // Init actions let action_debug = Action::new("win", true); diff --git a/src/app/database.rs b/src/app/database.rs index 65a8b533..d5a0dbd7 100644 --- a/src/app/database.rs +++ b/src/app/database.rs @@ -3,12 +3,12 @@ use std::sync::Arc; pub struct Database { connection: Arc, // Autostart migrate feature on app and db versions mismatch - version: String, + version: i32, } impl Database { // Construct new application DB - pub fn init(connection: Arc, version: &str) -> Database { + pub fn init(connection: Arc) -> Database { // Create app table if not exist yet /* connection @@ -27,7 +27,7 @@ impl Database { // Return struct Self { connection, - version: String::from(version), + version: 1, // @TODO } }