stepByStepHelper static method

OnUpgrade stepByStepHelper({
  1. required MigrationStepWithVersion step,
})

A helper used by drift internally to implement the step-by-step migration feature.

This method implements an OnUpgrade callback by repeatedly invoking step with the current version, assuming that step will perform an upgrade from that version to the version returned by the callback.

If you want to customize the way the migration steps are invoked, for instance by running statements before and afterwards, see runMigrationSteps.

Implementation

static OnUpgrade stepByStepHelper({
  required MigrationStepWithVersion step,
}) {
  return (m, from, to) async {
    return await runMigrationSteps(
      migrator: m,
      from: from,
      to: to,
      steps: step,
    );
  };
}