From 74ee7edc43be45d207343f1c485fd0c80346c313 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Mon, 14 Oct 2024 18:40:56 +0200 Subject: [PATCH 1/2] ci: Run workflows on ubuntu 22.04 (#1936) --- .github/workflows/lint-rust.yml | 2 +- .github/workflows/test-rust.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint-rust.yml b/.github/workflows/lint-rust.yml index 39cc37fe..d9e0c50c 100644 --- a/.github/workflows/lint-rust.yml +++ b/.github/workflows/lint-rust.yml @@ -126,7 +126,7 @@ jobs: clippy: needs: changes if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: diff --git a/.github/workflows/test-rust.yml b/.github/workflows/test-rust.yml index 016e3673..3793160d 100644 --- a/.github/workflows/test-rust.yml +++ b/.github/workflows/test-rust.yml @@ -168,7 +168,7 @@ jobs: } - { target: x86_64-unknown-linux-gnu, - os: ubuntu-latest, + os: ubuntu-22.04, runner: 'cargo', command: 'test' } From aef5dd61571bf56bf973136202a94b8dfd6730c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=8A=E5=BC=A6=E5=87=9D=E7=BB=9D?= <42119608+Goodjooy@users.noreply.github.com> Date: Tue, 15 Oct 2024 02:32:49 +0800 Subject: [PATCH 2/2] fix(sql): don't panic on missing migration when preload is enabled (#1932) Co-authored-by: Fabian-Lars --- plugins/sql/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/sql/src/lib.rs b/plugins/sql/src/lib.rs index ec9362bf..f66137b8 100644 --- a/plugins/sql/src/lib.rs +++ b/plugins/sql/src/lib.rs @@ -145,7 +145,9 @@ impl Builder { for db in config.preload { let pool = DbPool::connect(&db, app).await?; - if let Some(migrations) = self.migrations.as_mut().unwrap().remove(&db) { + if let Some(migrations) = + self.migrations.as_mut().and_then(|mm| mm.remove(&db)) + { let migrator = Migrator::new(migrations).await?; pool.migrate(&migrator).await?; }