Simpl-Resultat/src-tauri/src/commands
le king fu b0206ae56b fix(profiles): catch secondary profiles up on missed migrations (#390)
tauri-plugin-sql migrates only the database registered with add_migrations,
the default profile's. A secondary profile kept the consolidated schema of
the version that created it and never received a migration afterwards.

prepare_profile_db runs before every Database.load:
- secondary profiles catch up with the same migrations() list (pinned
  SHA-384), history kept in _sqlx_migrations; a database without history
  gets a floor inferred from its schema (the seven released creation
  states are test fixtures), so nothing at or below it is ever replayed;
- a VACUUM INTO copy is taken before the first write, synced, then renamed;
- each version runs in its own transaction with foreign keys on; one that
  fails on a foreign key is retried once without them and its orphans are
  set to NULL where the key declares ON DELETE SET NULL;
- every profile gets its TEXT manual-categorization flags repaired;
- failures are logged with file names only and the profile still opens.

New profiles are born with their full history (get_new_profile_init_sql).

The plugin keeps databases under app_config_dir(), not app_data_dir():
the same folder on Windows and macOS, not on Linux. repair_migrations,
delete_profile_db and compute_account_return looked in the wrong folder
there. profile_db_path resolves the plugin's folder and validates the
file name; deleting a profile now also removes its SQLite side files and
catch-up copies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 20:35:00 -04:00
..
account_cache.rs feat: HMAC-sign cached account info to close subscription tampering (#80) 2026-04-14 08:07:47 -04:00
auth_commands.rs feat: HMAC-sign cached account info to close subscription tampering (#80) 2026-04-14 08:07:47 -04:00
backup_commands.rs feat(categories): add restore backup banner and permanent restore action (#122) 2026-04-20 21:47:43 -04:00
balance_commands.rs fix(profiles): catch secondary profiles up on missed migrations (#390) 2026-10-06 20:35:00 -04:00
entitlements.rs fix(license): name key-entry errors, keep the edition off the activation token, flag revoked keys 2026-09-29 21:39:01 -04:00
export_import_commands.rs feat: add data export/import with optional AES-256-GCM encryption (#3) 2026-02-15 11:40:28 +00:00
feedback_commands.rs feat: feedback hub widget in Settings Logs card (#67) 2026-04-17 14:36:26 +00:00
fs_commands.rs feat(onboarding): create_sample_import_folders command, sample CSV templates and detection test (#354) 2026-10-03 19:50:41 -04:00
license_commands.rs fix(license): apply the review follow-ups on the license stack head 2026-10-05 19:13:36 -04:00
mod.rs feat(balance): add compute_account_return Tauri command 2026-04-25 16:23:14 -04:00
profile_commands.rs fix(profiles): catch secondary profiles up on missed migrations (#390) 2026-10-06 20:35:00 -04:00
return_calculator.rs fix(rust): wrap Modified Dietz formula doc block in text fence (S7) 2026-05-03 16:31:29 -04:00
token_store.rs feat: migrate OAuth tokens to OS keychain via token_store (#78) 2026-04-13 19:41:54 -04:00