WIP: restore database migration system and improve error handling

- Restore runMigrations functionality for database schema migrations
- Remove indexedDBMigrationService.ts (was for IndexedDB to SQLite migration)
- Recreate migrationService.ts and db-sql/migration.ts for schema management
- Add proper TypeScript error handling with type guards in AccountViewView
- Fix CreateAndSubmitClaimResult property access in QuickActionBvcBeginView
- Remove LeafletMouseEvent from Vue components array (it's a type, not component)
- Add null check for UserNameDialog callback to prevent undefined assignment
- Implement extractErrorMessage helper function for consistent error handling
- Update router to remove database-migration route

The migration system now properly handles database schema evolution
across app versions, while the IndexedDB to SQLite migration service
has been removed as it was specific to that one-time migration.
This commit is contained in:
Matthew Raymer
2025-06-23 08:25:10 +00:00
parent 3baa6633a6
commit daed0a97c9
70 changed files with 185 additions and 3986 deletions

View File

@@ -62,7 +62,6 @@ import { db } from "../db/index";
import { Log } from "../db/tables/logs";
import { logger } from "../utils/logger";
import { PlatformServiceFactory } from "../services/PlatformServiceFactory";
import { USE_DEXIE_DB } from "../constants/app";
import * as databaseUtil from "../db/databaseUtil";
@Component({
@@ -88,7 +87,7 @@ export default class LogView extends Vue {
this.error = null; // Clear any previous errors
this.memoryLogs = databaseUtil.memoryLogs;
let allLogs: Log[] = [];
const allLogs: Log[] = [];
const platformService = PlatformServiceFactory.getInstance();
const queryResult = await platformService.dbQuery(
"SELECT * FROM logs ORDER BY date DESC",
@@ -96,16 +95,6 @@ export default class LogView extends Vue {
this.logs = databaseUtil.mapQueryResultToValues(
queryResult,
) as unknown as Log[];
if (USE_DEXIE_DB) {
await db.open();
allLogs = await db.logs.toArray();
// Sort by date in reverse chronological order
this.logs = allLogs.sort((a, b) => {
const dateA = new Date(a.date);
const dateB = new Date(b.date);
return dateB.getTime() - dateA.getTime();
});
}
} catch (error) {
logger.error("Error loading logs:", error);
this.error =