Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Dec 26, 2024
1 parent d1b4a43 commit d8b55fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion crates/sqlx-migrate-validate/tests/validate.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::path::Path;

use sqlx::migrate::MigrateError;

use sqlx_migrate_validate::{Validate, ValidateError, Validator};

async fn prepare() -> sqlx::sqlite::SqliteConnection {
Expand Down
10 changes: 7 additions & 3 deletions ee/tabby-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,16 @@ impl DbConn {
/// for prod - db.backup-${date}.sqlite
/// for non-prod - dev-db.backup-${date}.sqlite
async fn backup_db(db_file: &Path, pool: &SqlitePool) -> Result<()> {

Check warning on line 167 in ee/tabby-db/src/lib.rs

View check run for this annotation

Codecov / codecov/patch

ee/tabby-db/src/lib.rs#L167

Added line #L167 was not covered by tests
use sqlx_migrate_validate::{Validate, Validator};
use sqlx_migrate_validate::Validate;

let mut conn = pool.acquire().await?;
if sqlx::migrate!("./migrations").validate(&mut *conn).await.is_ok() {
if sqlx::migrate!("./migrations")
.validate(&mut *conn)
.await
.is_ok()

Check warning on line 174 in ee/tabby-db/src/lib.rs

View check run for this annotation

Codecov / codecov/patch

ee/tabby-db/src/lib.rs#L170-L174

Added lines #L170 - L174 were not covered by tests
{
// No migration is needed, skip the backup.
return Ok(())
return Ok(());
}

Check warning on line 179 in ee/tabby-db/src/lib.rs

View check run for this annotation

Codecov / codecov/patch

ee/tabby-db/src/lib.rs#L177-L179

Added lines #L177 - L179 were not covered by tests
if !tokio::fs::try_exists(db_file).await? {
Expand Down

0 comments on commit d8b55fc

Please sign in to comment.