Migrations work
This code actually enables migrations by running migrations on initialization before any other code runs.
This commit is contained in:
parent
f7f81e0bda
commit
61439d65b3
2 changed files with 12 additions and 1 deletions
|
@ -95,9 +95,11 @@ mod song_model {
|
|||
#[qinvokable]
|
||||
pub fn setup(mut self: Pin<&mut Self>) {
|
||||
let db = &mut self.as_mut().get_db();
|
||||
run_migrations(db);
|
||||
|
||||
let results = songs
|
||||
.load::<crate::models::Song>(db)
|
||||
.expect("Error loading songs");
|
||||
.expect("NO TABLE?????????????");
|
||||
self.as_mut().set_highest_id(0);
|
||||
|
||||
println!("SHOWING SONGS");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue