feat: run migrations before init
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Aravinth Manivannan 2022-12-29 14:20:31 +05:30
parent 7e50f9be0d
commit bb0b6ef597
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
2 changed files with 1 additions and 3 deletions

View file

@ -14,14 +14,11 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
use std::collections::HashMap;
use actix_web::{web, HttpResponse, Responder}; use actix_web::{web, HttpResponse, Responder};
use actix_web_httpauth::middleware::HttpAuthentication; use actix_web_httpauth::middleware::HttpAuthentication;
use libforms::*; use libforms::*;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::db::FormSubmission;
use crate::errors::*; use crate::errors::*;
use crate::AppCtx; use crate::AppCtx;
use crate::*; use crate::*;

View file

@ -115,6 +115,7 @@ async fn main() -> std::io::Result<()> {
async fn serve(settings: Settings, ctx: AppCtx) -> std::io::Result<()> { async fn serve(settings: Settings, ctx: AppCtx) -> std::io::Result<()> {
let ip = settings.server.get_ip(); let ip = settings.server.get_ip();
ctx.db.migrate().await.unwrap();
println!("Starting server on: http://{ip}"); println!("Starting server on: http://{ip}");
HttpServer::new(move || { HttpServer::new(move || {