Add cleanup of temp table in sample rate migration

Drop any existing local_tracks_new table before starting migration
to handle cases where a previous migration attempt failed mid-execution.

This prevents 'table already exists' errors when retrying the migration.
This commit is contained in:
vicrodh committed 2026-01-19 20:07:32 -06:00
1 parent ba8a0d3fd7
commit 4080cfbfc8
1 file changed
+3
+3
View File
@@ -362,6 +362,9 @@ impl LibraryDatabase {
// CRITICAL: Explicitly list all columns to handle different DB versions safely
self.conn.execute_batch(
r#"
-- Clean up any leftover temp table from previous failed migration
DROP TABLE IF EXISTS local_tracks_new;
-- Create new table with REAL sample_rate (only core columns)
CREATE TABLE local_tracks_new (
id INTEGER PRIMARY KEY,