collab: Remove unused parameter to run_database_migrations (#15883)

This PR removes the unused `ignore_checksum_mismatch` parameter to
`run_database_migrations`.

We were always passing `false`, which meant the behavior didn't need to
be parameterized.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-08-06 17:31:52 -04:00 committed by GitHub
parent 7f6d0919c9
commit b19f85f9b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 6 deletions

View file

@ -93,7 +93,7 @@ impl TestDb {
.await
.unwrap();
let migrations_path = concat!(env!("CARGO_MANIFEST_DIR"), "/migrations");
run_database_migrations(db.options(), migrations_path, false)
run_database_migrations(db.options(), migrations_path)
.await
.unwrap();
db.initialize_notification_kinds().await.unwrap();

View file

@ -81,7 +81,7 @@ impl TestLlmDb {
.await
.unwrap();
let migrations_path = concat!(env!("CARGO_MANIFEST_DIR"), "/migrations_llm");
run_database_migrations(db.options(), migrations_path, false)
run_database_migrations(db.options(), migrations_path)
.await
.unwrap();
db

View file

@ -220,7 +220,7 @@ async fn setup_app_database(config: &Config) -> Result<()> {
Path::new(default_migrations)
});
let migrations = run_database_migrations(db.options(), migrations_path, false).await?;
let migrations = run_database_migrations(db.options(), migrations_path).await?;
for (migration, duration) in migrations {
log::info!(
"Migrated {} {} {:?}",
@ -265,7 +265,7 @@ async fn setup_llm_database(config: &Config) -> Result<()> {
Path::new(default_migrations)
});
let migrations = run_database_migrations(db.options(), migrations_path, false).await?;
let migrations = run_database_migrations(db.options(), migrations_path).await?;
for (migration, duration) in migrations {
log::info!(
"Migrated {} {} {:?}",

View file

@ -11,7 +11,6 @@ use sqlx::Connection;
pub async fn run_database_migrations(
database_options: &ConnectOptions,
migrations_path: impl AsRef<Path>,
ignore_checksum_mismatch: bool,
) -> Result<Vec<(Migration, Duration)>> {
let migrations = MigrationSource::resolve(migrations_path.as_ref())
.await
@ -31,7 +30,7 @@ pub async fn run_database_migrations(
for migration in migrations {
match applied_migrations.get(&migration.version) {
Some(applied_migration) => {
if migration.checksum != applied_migration.checksum && !ignore_checksum_mismatch {
if migration.checksum != applied_migration.checksum {
Err(anyhow!(
"checksum mismatch for applied migration {}",
migration.description