From 63abf1f90c8a457d16ed1ef78686e49bc1dba609 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Tue, 10 Feb 2026 08:37:30 -0600 Subject: [PATCH] fix: graphics settings store fails on existing databases The CREATE TABLE included force_x11 column but INSERT OR IGNORE also referenced it, so on existing DBs (without the column) the entire execute_batch failed before reaching the ALTER TABLE migration. Keep original schema in CREATE/INSERT, let ALTER add the new column. --- src-tauri/src/config/graphics_settings.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src-tauri/src/config/graphics_settings.rs b/src-tauri/src/config/graphics_settings.rs index 360f20450..1a959708b 100644 --- a/src-tauri/src/config/graphics_settings.rs +++ b/src-tauri/src/config/graphics_settings.rs @@ -49,13 +49,12 @@ impl GraphicsSettingsStore { conn.execute_batch( "CREATE TABLE IF NOT EXISTS graphics_settings ( id INTEGER PRIMARY KEY CHECK (id = 1), - hardware_acceleration INTEGER NOT NULL DEFAULT 0, - force_x11 INTEGER NOT NULL DEFAULT 0 + hardware_acceleration INTEGER NOT NULL DEFAULT 0 ); - INSERT OR IGNORE INTO graphics_settings (id, hardware_acceleration, force_x11) VALUES (1, 0, 0);" + INSERT OR IGNORE INTO graphics_settings (id, hardware_acceleration) VALUES (1, 0);" ).map_err(|e| format!("Failed to create graphics settings table: {}", e))?; - // Migration: add force_x11 column for existing databases + // Migration: add force_x11 column (no-op if already present) let _ = conn.execute_batch( "ALTER TABLE graphics_settings ADD COLUMN force_x11 INTEGER NOT NULL DEFAULT 0;" );