use migrate macro

This commit is contained in:
Joe Ardent 2024-04-15 22:13:08 -07:00
parent 79da5a02a6
commit 7b41e0f91b

View file

@ -1,7 +1,6 @@
use std::time::Duration;
use sqlx::{
migrate::Migrator,
sqlite::{SqliteConnectOptions, SqliteJournalMode, SqlitePoolOptions},
SqlitePool,
};
@ -73,10 +72,7 @@ pub fn get_db_pool() -> SqlitePool {
.build()
.unwrap();
let m = Migrator::new(std::path::Path::new("./migrations"));
let mut m = rt.block_on(m).unwrap();
let m = m.set_locking(false);
rt.block_on(m.run(&pool)).unwrap();
rt.block_on(sqlx::migrate!().run(&pool)).unwrap();
tracing::info!("Ran migrations");
}