mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-29 07:41:20 +00:00
Update utils.rs
This commit is contained in:
parent
394a859563
commit
4dd36f1a15
1 changed files with 4 additions and 0 deletions
|
@ -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.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue