From bf1aeb7191bfaa75f1acf47c675bc68b9fac1cd8 Mon Sep 17 00:00:00 2001 From: fx Date: Sat, 21 Oct 2023 21:11:28 +0200 Subject: add migrate macro --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 8b4e9eb..ce12cf6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,7 @@ use time::util::local_offset; use tracing::{info, level_filters::LevelFilter}; use tracing_subscriber::{EnvFilter, fmt::{self, time::LocalTime}, prelude::*}; use crate::config::SETTINGS; -use crate::db::{init_db_pool, setup_db}; +use crate::db::init_db_pool; use crate::routes::device::{get_device, post_device, put_device}; use crate::routes::start::start; @@ -41,7 +41,7 @@ async fn main() { info!("start webol v{}", version); let db = init_db_pool().await; - setup_db(&db).await.unwrap(); + sqlx::migrate!().run(&db).await.unwrap(); let shared_state = Arc::new(AppState { db }); -- cgit v1.2.3