use migrate macro
This commit is contained in:
parent
79da5a02a6
commit
7b41e0f91b
1 changed files with 1 additions and 5 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue