Update utils.rs

This commit is contained in:
dullbananas 2023-12-22 17:37:01 -07:00 committed by GitHub
parent 394a859563
commit 4dd36f1a15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,6 +10,7 @@ use chrono::{DateTime, Utc};
use deadpool::Runtime; use deadpool::Runtime;
use diesel::{ use diesel::{
backend::Backend, backend::Backend,
connection::SimpleConnection,
deserialize::FromSql, deserialize::FromSql,
helper_types::AsExprOf, helper_types::AsExprOf,
pg::Pg, pg::Pg,
@ -284,6 +285,9 @@ fn run_migrations(db_url: &str) {
let _ = &mut conn let _ = &mut conn
.run_pending_migrations(MIGRATIONS) .run_pending_migrations(MIGRATIONS)
.unwrap_or_else(|e| panic!("Couldn't run DB Migrations: {e}")); .unwrap_or_else(|e| panic!("Couldn't run DB Migrations: {e}"));
conn
.batch_execute(include_str!("../../../replaceable_schema.sql"))
.expect("Couldn't run replaceable_schema.sql");
info!("Database migrations complete."); info!("Database migrations complete.");
} }