-- App versions table
CREATE TABLE IF NOT EXISTS app_versions (
    id INT PRIMARY KEY AUTO_INCREMENT,
    version VARCHAR(20) NOT NULL,
    build_number INT NOT NULL,
    download_url TEXT NOT NULL,
    changelog TEXT,
    is_mandatory BOOLEAN DEFAULT 0,
    is_active BOOLEAN DEFAULT 1,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Insert default version
INSERT INTO app_versions (version, build_number, download_url, changelog, is_mandatory, is_active) VALUES
('1.0.0', 1, 'http://localhost/rssecurity_backend/downloads/app-v1.0.0.exe', 'Initial release', 0, 1);
