journey 1.1.1 copy "journey: ^1.1.1" to clipboard
journey: ^1.1.1 copied to clipboard

This package helps you run one-time migrations in your app incrementally, while trying to reduce impact on app start-up time as much as possible.

Journey #

As soon as your app is published it goes on this wild journey and likely receives new interesting features to benefit your users. Along the way there will be times when you need to run one-time migrations to prepare for these exciting new features!

This package helps you run one-time migrations in your app incrementally, while trying to reduce impact on app start-up time as much as possible.

Features #

Run incremental migrations.

Getting started #

To use Journey, you will need to include this package in your pubspec:

# pubspec.yaml
dependencies:
  journey:

Usage #

Create migration implementations for the all the migrations in your app:

class MigrateUserModelToHaveMultipleJourneys extends Migration {
  String get id => "migrate_user_model_to_have_multiple_journeys";

  @override
  Future<MigrationResult> migrate() async {
    // change the data model of your underlying data structure
    return MigrationResult.successful;
  }
}

class MigrateTokensToNativeSecureStorage extends Migration {
  String get id => "migrate_tokens_to_native_secure_storage";

  @override
  Future<MigrationResult> migrate() async {
    // read the tokens from the previous storage, and move them to the secure storage
    return MigrationResult.successful;
  }
}

Once you've defined your migrations, define the journey:

final journey = Journey(
  migrations: [
    MigrateUserModelToHaveMultipleJourneys(),
    MigrateTokensToNativeSecureStorage(),
  ],
);

After defining the journey, execute the migrations at an appropriate time in your app:

// U can use the reports for analytical purposes
final reports = await journey.migrate();

If at some point, or for testing, you want to execute migrations again, you can rollback migrations:

// rollback the migrations
await journey.rollback();

// reset all migration reports
await journey.reset();
5
likes
140
pub points
42%
popularity

Publisher

verified publisherjordylangen.com

This package helps you run one-time migrations in your app incrementally, while trying to reduce impact on app start-up time as much as possible.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, meta, path_provider

More

Packages that depend on journey