feat: run migrations automatically
This commit is contained in:
parent
633f73199d
commit
b4c24182ee
1 changed files with 7 additions and 2 deletions
|
@ -53,11 +53,11 @@ impl ForDiff {
|
||||||
log::info!("Difficulty factor {difficulty} generated in {time}");
|
log::info!("Difficulty factor {difficulty} generated in {time}");
|
||||||
times.push(time);
|
times.push(time);
|
||||||
}
|
}
|
||||||
let mean = (times.iter().sum::<u128>()/ trials as u128) as u32 ;
|
let mean = (times.iter().sum::<u128>() / trials as u128) as u32;
|
||||||
let simple_variance: u32 = (times
|
let simple_variance: u32 = (times
|
||||||
.iter()
|
.iter()
|
||||||
.map(|d| {
|
.map(|d| {
|
||||||
let x = (*d as u32 - mean ) as u32;
|
let x = (*d as u32 - mean) as u32;
|
||||||
x * x
|
x * x
|
||||||
})
|
})
|
||||||
.sum::<u32>())
|
.sum::<u32>())
|
||||||
|
@ -178,6 +178,11 @@ async fn main() {
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
sqlx::migrate!("./migrations/")
|
||||||
|
.run(&sqlite_db)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
println!("{:?}", args);
|
println!("{:?}", args);
|
||||||
let sled_db = sled::open(args.sled).unwrap();
|
let sled_db = sled::open(args.sled).unwrap();
|
||||||
for entry in sled_db.iter() {
|
for entry in sled_db.iter() {
|
||||||
|
|
Reference in a new issue