From bb0b6ef597fe668e0ebff0ae5ec2674e426462c3 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Thu, 29 Dec 2022 14:20:31 +0530 Subject: [PATCH] feat: run migrations before init --- src/api/v1/forms.rs | 3 --- src/main.rs | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/api/v1/forms.rs b/src/api/v1/forms.rs index aa51c54..2f70461 100644 --- a/src/api/v1/forms.rs +++ b/src/api/v1/forms.rs @@ -14,14 +14,11 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -use std::collections::HashMap; - use actix_web::{web, HttpResponse, Responder}; use actix_web_httpauth::middleware::HttpAuthentication; use libforms::*; use serde::{Deserialize, Serialize}; -use crate::db::FormSubmission; use crate::errors::*; use crate::AppCtx; use crate::*; diff --git a/src/main.rs b/src/main.rs index e9fe0cd..375dcac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -115,6 +115,7 @@ async fn main() -> std::io::Result<()> { async fn serve(settings: Settings, ctx: AppCtx) -> std::io::Result<()> { let ip = settings.server.get_ip(); + ctx.db.migrate().await.unwrap(); println!("Starting server on: http://{ip}"); HttpServer::new(move || {