feat(statistiques): implémentation backend statistiques de progression (ticket #82)
Lots B1+B2+B3 : schéma/domaine, requêtes d'agrégation et ports/use cases pour les statistiques de progression, avec tests associés. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -48,7 +48,7 @@ final class AppDatabase extends _$AppDatabase {
|
||||
}
|
||||
|
||||
@override
|
||||
int get schemaVersion => 17;
|
||||
int get schemaVersion => 18;
|
||||
|
||||
@override
|
||||
MigrationStrategy get migration {
|
||||
@ -228,10 +228,21 @@ final class AppDatabase extends _$AppDatabase {
|
||||
'CREATE INDEX IF NOT EXISTS idx_workout_history_started_at '
|
||||
'ON workout_history (started_at)',
|
||||
);
|
||||
await customStatement(
|
||||
'CREATE INDEX IF NOT EXISTS idx_workout_history_completed_started '
|
||||
'ON workout_history (completed, started_at) '
|
||||
'WHERE deleted_at IS NULL',
|
||||
);
|
||||
await customStatement(
|
||||
'CREATE INDEX IF NOT EXISTS idx_workout_history_set_results_history_id '
|
||||
'ON workout_history_set_results (workout_history_id)',
|
||||
);
|
||||
await customStatement(
|
||||
'CREATE INDEX IF NOT EXISTS idx_history_set_progression_exercise '
|
||||
'ON workout_history_set_results (source_exercise_id_snapshot, '
|
||||
'exercise_snapshot_id, workout_history_id, status) '
|
||||
'WHERE deleted_at IS NULL',
|
||||
);
|
||||
await customStatement(
|
||||
'CREATE INDEX IF NOT EXISTS '
|
||||
'idx_workout_history_set_results_source_exercise '
|
||||
@ -243,6 +254,12 @@ final class AppDatabase extends _$AppDatabase {
|
||||
'CREATE INDEX IF NOT EXISTS idx_workout_history_step_results_history_id '
|
||||
'ON workout_history_step_results (workout_history_id)',
|
||||
);
|
||||
await customStatement(
|
||||
'CREATE INDEX IF NOT EXISTS idx_history_step_progression_exercise '
|
||||
'ON workout_history_step_results (source_exercise_id_snapshot, '
|
||||
'exercise_snapshot_id, workout_history_id, status) '
|
||||
'WHERE deleted_at IS NULL',
|
||||
);
|
||||
await customStatement(
|
||||
'CREATE INDEX IF NOT EXISTS '
|
||||
'idx_workout_history_step_results_source_exercise '
|
||||
|
||||
Reference in New Issue
Block a user