diff --git a/database/schema/schema.sql b/database/schema/schema.sql index 27f0f5e..71e2f1a 100644 --- a/database/schema/schema.sql +++ b/database/schema/schema.sql @@ -26,13 +26,25 @@ CREATE TABLE users ( last_name VARCHAR(255), role VARCHAR(20) NOT NULL DEFAULT 'user' CHECK (role IN ('admin', 'user')), theme VARCHAR(50) DEFAULT 'tokyo-night', - scan_frequency_minutes INTEGER DEFAULT 60, - auto_scan_enabled BOOLEAN DEFAULT true, max_devices INTEGER DEFAULT 10, created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() ); +-- Create system_settings table +CREATE TABLE system_settings ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + setting_key VARCHAR(100) UNIQUE NOT NULL, + setting_value TEXT NOT NULL, + description TEXT, + updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() +); + +-- Insert default system settings +INSERT INTO system_settings (setting_key, setting_value, description) VALUES +('scan_frequency_minutes', '60', 'How often to scan all libraries in minutes'), +('auto_scan_enabled', 'true', 'Whether auto-scanning is enabled system-wide'); + -- Create refresh_tokens table CREATE TABLE refresh_tokens ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(),