• Welcome to RadioDJ - Free Radio Automation Software Forum. Please log in or sign up.

Fix for bug causing Rotations to fail after going from v1.8.2 to v2

Started by Calypso, January 28, 2018, 11:43:12 AM

Calypso

When you use rotations and have converted to v2 from 1.8.2, then you most certainly have noticed that the rotations are all there, but they don't work.

That problem is caused by 3 new columns in the database, and their default value (NULL); v2 doesn't like that.
If the conversion SQL script ("1.8.2 TO 2.sql") is changed, your conversion will work:


ALTER TABLE `rotations_list`
ADD COLUMN `mood` VARCHAR(250) NULL DEFAULT NULL AFTER `genID`,
ADD COLUMN `gender` VARCHAR(250) NULL DEFAULT NULL AFTER `mood`,
ADD COLUMN `language` VARCHAR(250) NULL DEFAULT NULL AFTER `gender`,
ADD COLUMN `start_type` INT(11) NOT NULL DEFAULT '0' AFTER `language`,
ADD COLUMN `end_type` INT(11) NOT NULL DEFAULT '0' AFTER `start_type`;


must become


ALTER TABLE `rotations_list`
ADD COLUMN `mood` VARCHAR(250) NULL DEFAULT "Any" AFTER `genID`,
ADD COLUMN `gender` VARCHAR(250) NULL DEFAULT "Any" AFTER `mood`,
ADD COLUMN `language` VARCHAR(250) NULL DEFAULT "Any" AFTER `gender`,
ADD COLUMN `start_type` INT(11) NOT NULL DEFAULT '0' AFTER `language`,
ADD COLUMN `end_type` INT(11) NOT NULL DEFAULT '0' AFTER `start_type`;


Maybe that can be incorporated in a future version to smoothen the migration process.


Brodephat

Nice! One question.... should Any be in single or double quotes?

"Any" or 'Any' or just Any
"Think Outside The Box And Make Something Truly Wonderful Happen"

Youtube Channel: https://bit.ly/3fGBsKJ

My RadioDJ Stations:
NiaRadioNetwork.com
RealPeopleTalkRadio.com
TheTriadComeUp.com

Radio Imaging & Tools:
CarterScripts.com

Free RDJ Videos:
HowToUseRadioDJ.com

Calypso

Quote from: Brodephat on January 28, 2018, 10:32:51 PM
Nice! One question.... should Any be in single or double quotes?

"Any" or 'Any' or just Any

I think in most MySQL versions it doesn't really matter if there are single or double quotes, at least quotes are neccesary since it's a VARCHAR variable