From 74eb19acdd7353a04ef3057478fa0454f5159d14 Mon Sep 17 00:00:00 2001 From: Namekuji Date: Mon, 10 Jul 2023 02:31:50 -0400 Subject: [PATCH] add environment variable to skip copying antenna --- .../src/m20230709_000510_move_antenna_to_cache.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/backend/native-utils/migration/src/m20230709_000510_move_antenna_to_cache.rs b/packages/backend/native-utils/migration/src/m20230709_000510_move_antenna_to_cache.rs index 7c38fd1bd6..d285678c91 100644 --- a/packages/backend/native-utils/migration/src/m20230709_000510_move_antenna_to_cache.rs +++ b/packages/backend/native-utils/migration/src/m20230709_000510_move_antenna_to_cache.rs @@ -10,13 +10,16 @@ pub struct Migration; impl MigrationTrait for Migration { async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { let cache_url = env::var("CACHE_URL").unwrap(); + let skip_copy = env::var("ANTENNA_MIGRATION_SKIP").unwrap_or_default(); let copy_limit = env::var("ANTENNA_MIGRATION_LIMIT").unwrap_or_default(); let copy_limit: i64 = match copy_limit.parse() { Ok(limit) => limit, Err(_) => 0, }; - if cache_url != "no" { + if skip_copy == "true" { + println!("Skipped antenna migration"); + } else { let prefix = env::var("CACHE_PREFIX").unwrap(); let db = manager.get_connection(); @@ -102,8 +105,9 @@ impl MigrationTrait for Migration { break; } } + + println!("Migrating antenna [100.00%]"); } - println!("Migrating antenna [100.00%]"); manager .drop_table(