CREATE TABLE IF NOT EXISTS download_version (
    id INT NOT NULL AUTO_INCREMENT,
    client_type VARCHAR(64) NOT NULL,
    version_name VARCHAR(64) NOT NULL,
    version_code INT NOT NULL DEFAULT 0,
    title VARCHAR(128) NOT NULL DEFAULT '',
    download_url TEXT NOT NULL,
    sha256 VARCHAR(128) NOT NULL DEFAULT '',
    file_size BIGINT NOT NULL DEFAULT 0,
    package_type TINYINT NOT NULL DEFAULT 0,
    force_update TINYINT NOT NULL DEFAULT 0,
    silent_update TINYINT NOT NULL DEFAULT 0,
    is_active TINYINT NOT NULL DEFAULT 1,
    release_notes TEXT,
    release_notes_html TEXT,
    min_supported_version VARCHAR(64) NOT NULL DEFAULT '',
    sort_order INT NOT NULL DEFAULT 0,
    created_at BIGINT NOT NULL DEFAULT 0,
    updated_at BIGINT NOT NULL DEFAULT 0,
    PRIMARY KEY (id),
    KEY idx_client_active (client_type, is_active),
    KEY idx_client_version_code (client_type, version_code)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
