パッケージ、リポジトリ、アプリカテゴリを検索

GitHub リポジトリMattiaPispisa/data_migration

データ移行

古いデータ構造のバージョンを最新のものに更新するために一連のマイグレーションを適用するためのライブラリです。

データ移行 のプロジェクト画像
スター
2
フォーク
0
最終プッシュ(UTC)
2024/12/18
プロジェクト状態
公開中

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

Data Migration

ci License: MIT coverage

A library for applying a series of migrations to update old versions of data structures to the most recent one.

Installation

dependencies:
  data_migration:

How to use

  1. Create your set of migration

    class CounterV1DataMigration implements DataMigration {
      const CounterV1DataMigration();
    
      @override
      int get fromVersion => 1;
    
      @override
      int get toVersion => 2;
    
      @override
      Future<dynamic> migrate(dynamic data) async {
        final counter = SimpleCounter(data as int);
        return counter.toJson();
      }
    }
    
    final migrator = DataMigrationManager(
      [
        CounterV1DataMigration(),
      ],
    );
    
  2. Apply migration on data

      final migrated1 = await _migrator.migrateIfNeeded(
         3,
         fromVersion: 1,
      );
    

Examples

In the example and tests, there are some examples of "data migration."

Mattia GitHub avatar
GitHub 作者

Mattia ↗

I have always been passionate about mobile development. I started with iOS and then transitioned to a hybrid approach.

MVLabsUdine, Italy公式サイト ↗
言語Dart

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 3 件

プロジェクトに合うリポジトリを選ぶには?

用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。

  1. 名前・作者・説明で検索し、技術トピックで絞り込みます。
  2. スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
  3. 利用前に GitHub で README、ライセンス、Issues を確認します。

情報源と管理

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗