diff options
author | fx <[email protected]> | 2023-10-21 21:11:28 +0200 |
---|---|---|
committer | fx <[email protected]> | 2023-10-21 21:11:28 +0200 |
commit | bf1aeb7191bfaa75f1acf47c675bc68b9fac1cd8 (patch) | |
tree | 5cd77421900fd8ec02f05d15e6fb195f28dfceb4 /src/main.rs | |
parent | f5928b90748b0bb4c0c498ccc77ebde4eaec8841 (diff) | |
download | webol-bf1aeb7191bfaa75f1acf47c675bc68b9fac1cd8.tar webol-bf1aeb7191bfaa75f1acf47c675bc68b9fac1cd8.tar.gz webol-bf1aeb7191bfaa75f1acf47c675bc68b9fac1cd8.zip |
add migrate macro
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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; | |||
7 | use tracing::{info, level_filters::LevelFilter}; | 7 | use tracing::{info, level_filters::LevelFilter}; |
8 | use tracing_subscriber::{EnvFilter, fmt::{self, time::LocalTime}, prelude::*}; | 8 | use tracing_subscriber::{EnvFilter, fmt::{self, time::LocalTime}, prelude::*}; |
9 | use crate::config::SETTINGS; | 9 | use crate::config::SETTINGS; |
10 | use crate::db::{init_db_pool, setup_db}; | 10 | use crate::db::init_db_pool; |
11 | use crate::routes::device::{get_device, post_device, put_device}; | 11 | use crate::routes::device::{get_device, post_device, put_device}; |
12 | use crate::routes::start::start; | 12 | use crate::routes::start::start; |
13 | 13 | ||
@@ -41,7 +41,7 @@ async fn main() { | |||
41 | info!("start webol v{}", version); | 41 | info!("start webol v{}", version); |
42 | 42 | ||
43 | let db = init_db_pool().await; | 43 | let db = init_db_pool().await; |
44 | setup_db(&db).await.unwrap(); | 44 | sqlx::migrate!().run(&db).await.unwrap(); |
45 | 45 | ||
46 | let shared_state = Arc::new(AppState { db }); | 46 | let shared_state = Arc::new(AppState { db }); |
47 | 47 | ||