diff --git a/lib/core/database.dart b/lib/core/database.dart index 3ec52ff..ac0a6f8 100644 --- a/lib/core/database.dart +++ b/lib/core/database.dart @@ -106,7 +106,15 @@ class DatabaseHelper { Future clearDatabase(String table) async { final db = await database; - await db.delete(table); + if (table == 'fitness') { + await db.execute('DROP TABLE IF EXISTS fitness'); + await db.execute( + 'CREATE TABLE fitness(id INTEGER PRIMARY KEY AUTOINCREMENT, weight TEXT, height INTEGER, age INTEGER, timestamp TEXT)', + ); + print('Fitness table recreated successfully'); + } else { + await db.delete(table); + } } Future> getRecordedExercises() async { diff --git a/pubspec.yaml b/pubspec.yaml index 9499265..2352b43 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 0.8.7+43 +version: 0.8.8+44 environment: sdk: '>=3.4.3 <4.0.0'