Migrations work

This code actually enables migrations by running migrations on
initialization before any other code runs.
This commit is contained in:
Chris Cochrun 2023-08-05 14:52:56 -05:00
parent f7f81e0bda
commit 61439d65b3
2 changed files with 12 additions and 1 deletions

View file

@ -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");