many changes
This commit is contained in:
@@ -17,6 +17,7 @@ pub const MIGRATIONS: &[(&str, &str)] = &[
|
||||
("012_download_source", MIGRATION_012),
|
||||
("013_downloads_item_status_index", MIGRATION_013),
|
||||
("014_series_audio_preferences", MIGRATION_014),
|
||||
("015_device_id", MIGRATION_015),
|
||||
];
|
||||
|
||||
/// Initial schema migration
|
||||
@@ -638,3 +639,20 @@ CREATE TABLE IF NOT EXISTS series_audio_preferences (
|
||||
CREATE INDEX IF NOT EXISTS idx_series_audio_prefs_user_series
|
||||
ON series_audio_preferences(user_id, series_id);
|
||||
"#;
|
||||
|
||||
/// Migration to add device ID storage
|
||||
/// - Creates app_settings table for app-wide configuration (device ID, etc.)
|
||||
/// - Device ID is generated once and persisted for Jellyfin server identification
|
||||
const MIGRATION_015: &str = r#"
|
||||
-- App-wide settings table for device ID and other app-level configuration
|
||||
-- Device ID is a unique identifier for this app installation
|
||||
-- Required for Jellyfin server communication and session tracking
|
||||
CREATE TABLE IF NOT EXISTS app_settings (
|
||||
key TEXT PRIMARY KEY,
|
||||
value TEXT NOT NULL,
|
||||
updated_at TEXT DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- Create index for efficient lookups (though key is already primary key)
|
||||
CREATE INDEX IF NOT EXISTS idx_app_settings_key ON app_settings(key);
|
||||
"#;
|
||||
|
||||
Reference in New Issue
Block a user