feat(core): consolide modele donnees stats par scope, types metier d'exercice et correctif contrainte active_exercise_step_progress_states
Couche domaine/application/infra locale partagee par #179 (stockage stats par etape/serie/exercice/seance), #182 (correctif contrainte UNIQUE active_exercise_step_progress_states) et #183 (modele/persistance types metier d'exercice). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -51,7 +51,7 @@ final class AppDatabase extends _$AppDatabase {
|
||||
}
|
||||
|
||||
@override
|
||||
int get schemaVersion => 24;
|
||||
int get schemaVersion => 25;
|
||||
|
||||
@override
|
||||
MigrationStrategy get migration {
|
||||
@ -60,6 +60,7 @@ final class AppDatabase extends _$AppDatabase {
|
||||
await migrator.createAll();
|
||||
await _migrateToSchema15();
|
||||
await _migrateToSchema16(migrator);
|
||||
await _migrateToSchema25();
|
||||
await _createIndexes();
|
||||
},
|
||||
onUpgrade: (migrator, from, to) async {
|
||||
@ -137,6 +138,9 @@ final class AppDatabase extends _$AppDatabase {
|
||||
if (from < 24) {
|
||||
await _migrateToSchema24(migrator);
|
||||
}
|
||||
if (from < 25) {
|
||||
await _migrateToSchema25();
|
||||
}
|
||||
await _createIndexes();
|
||||
},
|
||||
beforeOpen: (details) async {
|
||||
@ -956,6 +960,16 @@ FROM pending_share_actions
|
||||
await migrator.createTable(workoutTelemetryAggregates);
|
||||
}
|
||||
|
||||
Future<void> _migrateToSchema25() async {
|
||||
await _addColumnIfMissing(
|
||||
tableName: 'exercises',
|
||||
columnName: 'business_types_json',
|
||||
definition:
|
||||
"business_types_json TEXT NOT NULL DEFAULT '[]' "
|
||||
'CHECK (json_valid(business_types_json))',
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _backfillWorkoutHistorySetSourceExerciseIds() async {
|
||||
await customStatement(r'''
|
||||
UPDATE workout_history_set_results AS result
|
||||
|
||||
Reference in New Issue
Block a user