You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation runs all the sql migrations and then the rust migrations for post-migration code. We should refactor this function so that we can run a pair of sql+rust migrations at a time.
Desired behavior
The sqlx::migrate!(); macro returns a Migrator instance that returns the migration names (name+version given in the file name). The Migrator struct is pretty limited and doesn't allow running migrations one by one.
We should consider writing a wrapper around this struct to have more control over migrations and add the functionality to run arbitrary rust code given a migration name.
// within a function like // https://github.com/launchbadge/sqlx/blob/main/sqlx-core/src/migrate/migrator.rs#L118let rust_migrator = RustMigrator::new(..);for migration inself.iter(){// ..
conn.apply(migration).await?;
rust_migrator.apply(migration).await?;}
The text was updated successfully, but these errors were encountered:
Current behavior
The current implementation runs all the sql migrations and then the rust migrations for post-migration code. We should refactor this function so that we can run a pair of sql+rust migrations at a time.
Desired behavior
The
sqlx::migrate!();
macro returns aMigrator
instance that returns the migration names (name+version given in the file name). TheMigrator
struct is pretty limited and doesn't allow running migrations one by one.We should consider writing a wrapper around this struct to have more control over migrations and add the functionality to run arbitrary rust code given a migration name.
The text was updated successfully, but these errors were encountered: