v1.0.0
data_migration
오래된 데이터 구조의 버전을 최신 버전으로 업데이트하기 위해 일련의 마이그레이션을 적용하는 라이브러리입니다.
3좋아요 4430일 다운로드150Pub 점수
AndroidiOSWebmacOSWindowsLinux
오래된 데이터 구조의 버전을 최신 버전으로 업데이트하기 위해 일련의 마이그레이션을 적용하는 라이브러리입니다.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A library for applying a series of migrations to update old versions of data structures to the most recent one.
dependencies:
data_migration:
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(),
],
);
Apply migration on data
final migrated1 = await _migrator.migrateIfNeeded(
3,
fromVersion: 1,
);
In the example and tests, there are some examples of "data migration."
의존성 목록 3 개
^1.0.4^1.25.7^6.0.0사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗