Change database log level to debug
This commit is contained in:
@@ -2,7 +2,7 @@ pub use sea_orm_migration::prelude::*;
|
||||
|
||||
mod migrations;
|
||||
use migrations::*;
|
||||
use sea_orm_migration::sea_orm::Database;
|
||||
use sea_orm_migration::sea_orm::{ConnectOptions, Database};
|
||||
|
||||
pub struct Migrator;
|
||||
|
||||
@@ -17,7 +17,16 @@ impl MigratorTrait for Migrator {
|
||||
}
|
||||
|
||||
pub async fn migrate_database(db_url: &str) -> Result<(), DbErr> {
|
||||
let db = Database::connect(db_url).await?;
|
||||
let mut opt = ConnectOptions::new(db_url);
|
||||
opt.max_connections(10)
|
||||
.min_connections(0)
|
||||
.connect_timeout(std::time::Duration::from_secs(8))
|
||||
.idle_timeout(std::time::Duration::from_secs(8))
|
||||
.test_before_acquire(true)
|
||||
.sqlx_logging(true)
|
||||
.sqlx_logging_level(log::LevelFilter::Debug);
|
||||
let db = Database::connect(opt).await?;
|
||||
|
||||
Migrator::up(&db, None).await
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user