Skip to content

Commit

Permalink
fix(database): avoid deleting the database on launch
Browse files Browse the repository at this point in the history
  • Loading branch information
casimir committed Feb 17, 2025
1 parent 537f985 commit ec7e34b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/db/connection/native.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ QueryExecutor openConnection() {

final dbFile = await getDBPath(kDebugMode);
if (kDebugMode) {
print('DEBUG: database path: "${dbFile.path}"');
print('DEBUG: database path: "${dbFile.path}"');
print('DEBUG: database exists: ${dbFile.existsSync()}');
}
return NativeDatabase.createInBackground(
dbFile,
Expand All @@ -58,6 +59,8 @@ Future<void> _cleanOldDBs() async {
}

Future<void> _moveToContainer(bool devmode) async {
if (!UniversalPlatform.isIOS) return;

final source = await getDBPath(devmode, container: false);
if (source.existsSync()) {
final dest = await getDBPath(devmode);
Expand Down

0 comments on commit ec7e34b

Please sign in to comment.