Run database migrations on start

This commit is contained in:
Ethan Girouard 2024-02-04 23:33:59 -05:00
parent bd8b27a9ad
commit 540f9d2f72
Signed by: eta357
GPG Key ID: 7BCDC36DFD11C146

View File

@ -8,12 +8,18 @@ extern crate openssl;
#[macro_use] #[macro_use]
extern crate diesel; extern crate diesel;
#[cfg(feature = "ssr")]
extern crate diesel_migrations;
#[cfg(feature = "ssr")] #[cfg(feature = "ssr")]
#[actix_web::main] #[actix_web::main]
async fn main() -> std::io::Result<()> { async fn main() -> std::io::Result<()> {
use dotenv::dotenv; use dotenv::dotenv;
dotenv().ok(); dotenv().ok();
// Bring the database up to date
libretunes::database::migrate();
use actix_files::Files; use actix_files::Files;
use actix_web::*; use actix_web::*;
use leptos::*; use leptos::*;