From af5fca7dcad39a096b77bcff16fe9e5ee84e3b74 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Sat, 22 Jun 2019 19:02:25 +0200 Subject: [PATCH] Migrate example to new opening callback --- moor/example/example.dart | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/moor/example/example.dart b/moor/example/example.dart index 6fff6770..e34ee985 100644 --- a/moor/example/example.dart +++ b/moor/example/example.dart @@ -45,10 +45,14 @@ class Database extends _$Database { int get schemaVersion => 1; @override - // todo migrate - MigrationStrategy get migration => MigrationStrategy(onFinished: () async { + MigrationStrategy get migration { + return MigrationStrategy( + beforeOpen: (engine, details) async { // populate data - await into(categories) + await engine + .into(categories) .insert(const CategoriesCompanion(description: Value('Sweets'))); - }); + }, + ); + } }