feat: add database migration step to ensure schema consistency

- Implemented a migration step in the LibraryManager to ensure the database schema is up to date before proceeding with operations.
- This change enhances the reliability of the application by preventing potential schema-related issues during runtime.
This commit is contained in:
Jamie Pine 2025-11-18 02:36:31 -08:00
parent ad63cba189
commit 5a6c3eb5a0

View File

@ -418,6 +418,9 @@ impl LibraryManager {
let db_path = path.join("database.db");
let db = Arc::new(Database::open(&db_path).await?);
// Run migrations to ensure schema is up to date
db.migrate().await?;
// Get this device's ID for sync coordination
let device_id = context
.device_manager