-- Migration: ajout colonnes scheduledTime et autoFetchEnabled dans rss_settings
-- Alignement du schéma Drizzle avec la table existante

ALTER TABLE rss_settings 
  ADD COLUMN IF NOT EXISTS scheduledTime VARCHAR(5) DEFAULT '06:00',
  ADD COLUMN IF NOT EXISTS autoFetchEnabled TINYINT(1) NOT NULL DEFAULT 1;

UPDATE rss_settings SET autoFetchEnabled = isEnabled WHERE 1=1;
UPDATE rss_settings SET scheduledTime = '06:00' WHERE scheduledTime IS NULL OR scheduledTime = '';
