mirror of
https://github.com/wger-project/flutter.git
synced 2026-12-06 15:54:31 +01:00
fix: make routineId nullable in WorkoutLogTable to prevent crash
Server allows workout logs without a routine (free/ad-hoc logging), but the app's Drift table declared routineId as non-nullable. This caused a null check operator crash when PowerSync delivered a row with routine_id = NULL. Changes: - WorkoutLogTable.routineId: integer() → integer().nullable() - Log.routineId: late int → int? - Log constructor: required this.routineId → this.routineId - Log.toCompanion: handle null routineId with Value.absent() Fixes #1250
This commit is contained in:
2 files changed
+4
-4
No files matched your search
@@ -65,7 +65,7 @@ class WorkoutLogTable extends Table {
|
||||
|
||||
TextColumn get id => text().clientDefault(() => ps.uuid.v7())();
|
||||
IntColumn get exerciseId => integer().named('exercise_id')();
|
||||
IntColumn get routineId => integer().named('routine_id')();
|
||||
IntColumn get routineId => integer().named('routine_id').nullable()();
|
||||
TextColumn get sessionId => text().named('session_id').nullable()();
|
||||
IntColumn get iteration => integer().nullable()();
|
||||
IntColumn get slotEntryId => integer().named('slot_entry_id').nullable()();
|
||||
|
||||
Reference in new issue
Block a user