mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
use internal db version
This commit is contained in:
parent
8aa5474c20
commit
afd9bc3134
2 changed files with 4 additions and 4 deletions
|
|
@ -47,7 +47,7 @@ impl App {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Init database model
|
// Init database model
|
||||||
let database = Arc::new(Database::init(connection, env!("CARGO_PKG_VERSION")));
|
let database = Arc::new(Database::init(connection));
|
||||||
|
|
||||||
// Init actions
|
// Init actions
|
||||||
let action_debug = Action::new("win", true);
|
let action_debug = Action::new("win", true);
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,12 @@ use std::sync::Arc;
|
||||||
pub struct Database {
|
pub struct Database {
|
||||||
connection: Arc<sqlite::Connection>,
|
connection: Arc<sqlite::Connection>,
|
||||||
// Autostart migrate feature on app and db versions mismatch
|
// Autostart migrate feature on app and db versions mismatch
|
||||||
version: String,
|
version: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Database {
|
impl Database {
|
||||||
// Construct new application DB
|
// Construct new application DB
|
||||||
pub fn init(connection: Arc<sqlite::Connection>, version: &str) -> Database {
|
pub fn init(connection: Arc<sqlite::Connection>) -> Database {
|
||||||
// Create app table if not exist yet
|
// Create app table if not exist yet
|
||||||
/*
|
/*
|
||||||
connection
|
connection
|
||||||
|
|
@ -27,7 +27,7 @@ impl Database {
|
||||||
// Return struct
|
// Return struct
|
||||||
Self {
|
Self {
|
||||||
connection,
|
connection,
|
||||||
version: String::from(version),
|
version: 1, // @TODO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue