ALTER TABLE radios
    ADD COLUMN IF NOT EXISTS stream_url varchar(255) NULL AFTER player_key,
    ADD COLUMN IF NOT EXISTS stream_mount varchar(120) NULL AFTER stream_url,
    ADD COLUMN IF NOT EXISTS provision_status varchar(40) NOT NULL DEFAULT 'local' AFTER stream_mount,
    ADD COLUMN IF NOT EXISTS provision_error text NULL AFTER provision_status;

UPDATE radios
SET
    stream_url = IF(stream_url IS NULL OR stream_url = '', CONCAT('http://172.24.95.192:8000/', slug, '.mp3'), stream_url),
    stream_mount = IF(stream_mount IS NULL OR stream_mount = '', CONCAT(slug, '.mp3'), stream_mount),
    provision_status = IF(provision_status IS NULL OR provision_status = '', 'local', provision_status);

ALTER TABLE radios
    ADD UNIQUE KEY IF NOT EXISTS uniq_radios_slug (slug);
