Selaa lähdekoodia

chore(authentication): remove auto-migration

Bryan Lee 1 vuosi sitten
vanhempi
commit
458caeb166
3 muutettua tiedostoa jossa 0 lisäystä ja 19 poistoa
  1. 0 3
      authentication/src/build.rs
  2. 0 12
      authentication/src/db.rs
  3. 0 4
      authentication/src/main.rs

+ 0 - 3
authentication/src/build.rs

@@ -1,3 +0,0 @@
-fn main() {
-    println!("cargo:rerun-if-changed=migrations")
-}

+ 0 - 12
authentication/src/db.rs

@@ -38,15 +38,3 @@ where
         Ok(())
     }
 }
-
-use crate::config;
-use diesel_async_migrations::{embed_migrations, EmbeddedMigrations};
-
-pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!();
-
-pub async fn run_pending_migrations(
-) -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
-    let mut conn = AsyncPgConnection::establish(&config::DB_URL).await?;
-    MIGRATIONS.run_pending_migrations(&mut conn).await?;
-    Ok(())
-}

+ 0 - 4
authentication/src/main.rs

@@ -15,10 +15,6 @@ async fn main() -> std::io::Result<()> {
     std::env::set_var("RUST_LOG", "actix_web=debug,actix_server=info");
     env_logger::init();
 
-    db::run_pending_migrations()
-        .await
-        .expect("Failed to apply database migrations");
-
     let db_pool = db::initialize_db_pool(&config::DB_URL).await;
     let identity_config = config::IDENTITY_CONFIG.clone();