-- Video type + file + SMTP settings (fizasie)
USE fizasie;

ALTER TABLE videos
    ADD COLUMN IF NOT EXISTS video_type VARCHAR(20) NOT NULL DEFAULT 'youtube' AFTER title,
    ADD COLUMN IF NOT EXISTS video_file VARCHAR(255) NULL AFTER video_url;

-- MySQL 5.7 may not support IF NOT EXISTS on ADD COLUMN — run manually if error:
-- ALTER TABLE videos ADD COLUMN video_type VARCHAR(20) NOT NULL DEFAULT 'youtube';
-- ALTER TABLE videos ADD COLUMN video_file VARCHAR(255) NULL;

INSERT INTO site_settings (setting_key, setting_value) VALUES
('smtp_enabled', '0'),
('smtp_host', ''),
('smtp_port', '587'),
('smtp_encryption', 'tls'),
('smtp_user', ''),
('smtp_pass', ''),
('smtp_from_email', ''),
('smtp_from_name', 'Fizasite'),
('smtp_notify_email', '')
ON DUPLICATE KEY UPDATE setting_key = setting_key;
