This commit is contained in:
2026-05-10 03:16:13 +02:00
parent 5f05108132
commit 0b441b0759
77 changed files with 2100 additions and 71 deletions
+3 -7
View File
@@ -1,6 +1,6 @@
use std::time::Duration;
use sea_orm::{ConnectOptions, Database as SeaDatabase, DatabaseConnection, DbErr};
use migration::{Migrator, MigratorTrait};
use std::time::Duration;
#[derive(Clone)]
pub struct Database {
@@ -19,10 +19,6 @@ impl Database {
let connection = SeaDatabase::connect(opt).await?;
// On lance les migrations ici.
// Si ça échoue, le programme s'arrête proprement à l'init.
Migrator::up(&connection, None).await?;
Ok(Self { connection })
}
@@ -31,4 +27,4 @@ impl Database {
pub fn get_connection(&self) -> &DatabaseConnection {
&self.connection
}
}
}