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:
parent
7f6d0919c9
commit
b19f85f9b5
4 changed files with 5 additions and 6 deletions
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {} {} {:?}",
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue