added auto migrations and made cargo rebuild if migrations changed
This commit is contained in:
@@ -15,6 +15,9 @@ pub struct Database {
|
||||
|
||||
impl Database {
|
||||
pub async fn new(config: &Config) -> anyhow::Result<Self> {
|
||||
|
||||
sqlx::migrate!("./migrations");
|
||||
|
||||
log::info!("Database connecting to {}", config.database.url);
|
||||
let conn = PgPoolOptions::new()
|
||||
.max_connections(5)
|
||||
|
||||
Reference in New Issue
Block a user