feat(watch): clôture lot #91 - fréquence cardiaque live, notifications de séance et finitions montre
Consolide le lot applicatif watch companion validé : - télémétrie fréquence cardiaque live remontée montre -> téléphone (collecteur watch, adapter Wear Data Layer, persistance Drift, propagation aux écrans historique/programme/profil/exécution) - notifications de séance en arrière-plan côté téléphone (service foreground de statut + passerelle applicative) - finitions montre : chrono d'étape, score d'étape, retrait du bouton "lancer une séance", thème, icônes et polices watch_app Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -10,6 +10,7 @@ part 'app_database.g.dart';
|
||||
ActiveExerciseStepProgressStates,
|
||||
ActiveExerciseStepResults,
|
||||
ActiveRestStates,
|
||||
ActiveManualScoreStates,
|
||||
ActiveScoreStopwatchStates,
|
||||
ActiveSetTimerStates,
|
||||
ActiveSetResults,
|
||||
@ -48,7 +49,7 @@ final class AppDatabase extends _$AppDatabase {
|
||||
}
|
||||
|
||||
@override
|
||||
int get schemaVersion => 19;
|
||||
int get schemaVersion => 22;
|
||||
|
||||
@override
|
||||
MigrationStrategy get migration {
|
||||
@ -119,6 +120,15 @@ final class AppDatabase extends _$AppDatabase {
|
||||
if (from < 19) {
|
||||
await _migrateToSchema19();
|
||||
}
|
||||
if (from < 20) {
|
||||
await _migrateToSchema20(migrator);
|
||||
}
|
||||
if (from < 21) {
|
||||
await _migrateToSchema21();
|
||||
}
|
||||
if (from < 22) {
|
||||
await _migrateToSchema22();
|
||||
}
|
||||
await _createIndexes();
|
||||
},
|
||||
beforeOpen: (details) async {
|
||||
@ -199,6 +209,10 @@ final class AppDatabase extends _$AppDatabase {
|
||||
'CREATE INDEX IF NOT EXISTS idx_active_set_results_session_id '
|
||||
'ON active_set_results (active_workout_session_id)',
|
||||
);
|
||||
await customStatement(
|
||||
'CREATE INDEX IF NOT EXISTS idx_active_manual_score_states_session_id '
|
||||
'ON active_manual_score_states (active_workout_session_id)',
|
||||
);
|
||||
await customStatement(
|
||||
'CREATE INDEX IF NOT EXISTS idx_active_score_stopwatch_states_session_id '
|
||||
'ON active_score_stopwatch_states (active_workout_session_id)',
|
||||
@ -288,6 +302,7 @@ final class AppDatabase extends _$AppDatabase {
|
||||
const _syncableTableNames = [
|
||||
'active_exercise_step_progress_states',
|
||||
'active_exercise_step_results',
|
||||
'active_manual_score_states',
|
||||
'active_rest_states',
|
||||
'active_score_stopwatch_states',
|
||||
'active_set_timer_states',
|
||||
@ -770,6 +785,37 @@ CREATE TABLE IF NOT EXISTS active_set_timer_states (
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _migrateToSchema20(Migrator migrator) async {
|
||||
await migrator.createTable(activeManualScoreStates);
|
||||
}
|
||||
|
||||
Future<void> _migrateToSchema21() async {
|
||||
await _addColumnIfMissing(
|
||||
tableName: 'workout_history',
|
||||
columnName: 'average_heart_rate_bpm',
|
||||
definition:
|
||||
'average_heart_rate_bpm REAL CHECK '
|
||||
'(average_heart_rate_bpm IS NULL OR average_heart_rate_bpm > 0)',
|
||||
);
|
||||
await _addColumnIfMissing(
|
||||
tableName: 'workout_history',
|
||||
columnName: 'max_heart_rate_bpm',
|
||||
definition:
|
||||
'max_heart_rate_bpm INTEGER CHECK '
|
||||
'(max_heart_rate_bpm IS NULL OR max_heart_rate_bpm > 0)',
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _migrateToSchema22() async {
|
||||
await _addColumnIfMissing(
|
||||
tableName: 'exercise_steps',
|
||||
columnName: 'linked_to_series_score',
|
||||
definition:
|
||||
'linked_to_series_score INTEGER NOT NULL DEFAULT 0 '
|
||||
'CHECK (linked_to_series_score IN (0, 1))',
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _backfillWorkoutHistorySetSourceExerciseIds() async {
|
||||
await customStatement(r'''
|
||||
UPDATE workout_history_set_results AS result
|
||||
|
||||
Reference in New Issue
Block a user