From af3fd6968848cc4f22d0727a3f63a7b27f438b4e Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Tue, 28 Nov 2023 14:54:02 +1300 Subject: [PATCH] Convert noSound -> no_sound --- lib/database.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/database.dart b/lib/database.dart index 3ecc1a1..c575b8d 100644 --- a/lib/database.dart +++ b/lib/database.dart @@ -17,7 +17,7 @@ class MyDatabase extends _$MyDatabase { MyDatabase() : super(_openConnection()); @override - int get schemaVersion => 2; + int get schemaVersion => 3; @override MigrationStrategy get migration => MigrationStrategy( @@ -55,6 +55,12 @@ class MyDatabase extends _$MyDatabase { UPDATE settings SET show_unit = showUnit '''); } + if (from == 2) { + await m.addColumn(settings, settings.noSound); + await db.customStatement(''' + UPDATE settings SET no_sound = noSound + '''); + } }, ); }