Ajoute la synchronisation client incrémentale LWW vers l'API serveur (application/use_cases.dart: SyncUseCases, ports.dart, migration Drift schemaVersion 10→11 pour les métadonnées de sync et mappings de ressources, infrastructure/remote/sync_api.dart) et l'écran de profil avec entrée sur l'accueil (presentation/profile_screen.dart, home_screen.dart, presentation.dart). Développés dans le même worktree partagé par DevBackend et DevFrontend ; commit combiné car test/presentation/home_screen_test.dart mélange authentiquement les deux tickets (le test de l'entrée Profil et la mise à jour du fake de bootstrap requise par le nouveau getter syncUseCases sur AppDependencies). Corrige au passage une couleur `crimson` inexistante dans le thème (remplacée par colorScheme.error) et une signature de paramètres positionnels/nommés incohérente sur un fake de test. flutter pub get OK, build_runner OK, dart format appliqué, analyze propre (mêmes infos préexistantes), 119/119 tests verts, build APK debug validé. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -21,6 +21,8 @@ part 'app_database.g.dart';
|
||||
OnlineAccountSessions,
|
||||
ProgramExercises,
|
||||
Programs,
|
||||
RemoteResourceMappings,
|
||||
SyncMetadataEntries,
|
||||
WorkoutHistories,
|
||||
WorkoutHistorySetResults,
|
||||
WorkoutHistoryStepResults,
|
||||
@ -42,7 +44,7 @@ final class AppDatabase extends _$AppDatabase {
|
||||
}
|
||||
|
||||
@override
|
||||
int get schemaVersion => 10;
|
||||
int get schemaVersion => 11;
|
||||
|
||||
@override
|
||||
MigrationStrategy get migration {
|
||||
@ -87,6 +89,9 @@ final class AppDatabase extends _$AppDatabase {
|
||||
if (from < 10) {
|
||||
await _migrateToSchema10(migrator);
|
||||
}
|
||||
if (from < 11) {
|
||||
await _migrateToSchema11(migrator);
|
||||
}
|
||||
await _createIndexes();
|
||||
},
|
||||
beforeOpen: (details) async {
|
||||
@ -131,6 +136,10 @@ final class AppDatabase extends _$AppDatabase {
|
||||
'CREATE INDEX IF NOT EXISTS idx_online_account_sessions_logged_in '
|
||||
'ON online_account_sessions (is_logged_in, updated_at)',
|
||||
);
|
||||
await customStatement(
|
||||
'CREATE INDEX IF NOT EXISTS idx_remote_resource_mappings_resource '
|
||||
'ON remote_resource_mappings (resource_type, client_id)',
|
||||
);
|
||||
await customStatement(
|
||||
'CREATE INDEX IF NOT EXISTS idx_workout_template_programs_template_id '
|
||||
'ON workout_template_programs (workout_template_id)',
|
||||
@ -327,4 +336,9 @@ extension on AppDatabase {
|
||||
Future<void> _migrateToSchema10(Migrator migrator) async {
|
||||
await migrator.createTable(onlineAccountSessions);
|
||||
}
|
||||
|
||||
Future<void> _migrateToSchema11(Migrator migrator) async {
|
||||
await migrator.createTable(syncMetadataEntries);
|
||||
await migrator.createTable(remoteResourceMappings);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user