@@ -189,7 +189,8 @@ fn migrate(
190 println!("Applying {} migrations\n", remaining_migrations.len());
190 println!("Applying {} migrations\n", remaining_migrations.len());
192+ let target_migration = remaining_migrations.last().unwrap().name.to_string();
192− helpers::set_up_helpers(db, ¤t_migration).context("failed to set up helpers")?;
193+ helpers::set_up_helpers(db, &target_migration).context("failed to set up helpers")?;
194 let mut new_schema = Schema::new();
195 let mut new_schema = Schema::new();
195 let mut last_migration_index = usize::MAX;
196 let mut last_migration_index = usize::MAX;
@@ -244,7 +245,6 @@ fn migrate(
246 // Create schema and views for migration
247 // Create schema and views for migration
247− let target_migration = remaining_migrations.last().unwrap().name.to_string();
248 create_schema_for_migration(db, &target_migration, &new_schema)
248 create_schema_for_migration(db, &target_migration, &new_schema)
249 .with_context(|| format!("failed to create schema for migration {}", target_migration))?;
249 .with_context(|| format!("failed to create schema for migration {}", target_migration))?;