push-cargo-lock #61
2 changed files with 11 additions and 0 deletions
|
@ -16,4 +16,8 @@ impl Database {
|
||||||
conn: sea_orm::Database::connect(options).await?,
|
conn: sea_orm::Database::connect(options).await?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn connection(&self) -> &DatabaseConnection {
|
||||||
|
&self.conn
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,9 @@ mod error;
|
||||||
|
|
||||||
pub use db::Database;
|
pub use db::Database;
|
||||||
pub use db::entity;
|
pub use db::entity;
|
||||||
|
use log::info;
|
||||||
|
use migration::Migrator;
|
||||||
|
use migration::MigratorTrait;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
struct AppConfig {
|
struct AppConfig {
|
||||||
|
@ -24,6 +27,10 @@ async fn main() -> std::io::Result<()> {
|
||||||
|
|
||||||
let database = Database::new(database_url.into()).await.unwrap();
|
let database = Database::new(database_url.into()).await.unwrap();
|
||||||
|
|
||||||
|
info!("Running migrations");
|
||||||
|
Migrator::up(database.connection(), None).await.unwrap();
|
||||||
|
info!("Migrations completed");
|
||||||
|
|
||||||
let redis_conn = connect_to_redis_database().await;
|
let redis_conn = connect_to_redis_database().await;
|
||||||
|
|
||||||
let app_config = AppConfig { ldap_auth: false };
|
let app_config = AppConfig { ldap_auth: false };
|
||||||
|
|
Loading…
Add table
Reference in a new issue