fix: only run the pending migrations on server

This commit is contained in:
Matouš Volf 2024-09-13 10:10:20 +02:00
parent 9f6e5e450d
commit d41879d8ed
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,3 @@
#!/bin/bash #!/bin/bash
diesel migration run
supervisord -c /etc/supervisor/conf.d/supervisord.conf supervisord -c /etc/supervisor/conf.d/supervisord.conf

View File

@ -17,7 +17,9 @@ fn main() {
dioxus_logger::init(Level::INFO).expect("Failed to initialize the logger."); dioxus_logger::init(Level::INFO).expect("Failed to initialize the logger.");
info!("Running migrations."); info!("Running migrations.");
migrations::run_migrations().expect("Failed to run migrations."); server_only!(
migrations::run_migrations().expect("Failed to run migrations.");
);
info!("Starting app."); info!("Starting app.");
let cfg = server_only!( let cfg = server_only!(