SET NAMES 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
-- look at the data_source table for confimation we are grabbing the correct ID values
SET @BaronAppID = 'B500D9B2-1864-49E6-B446-A0AC70F90FEA'
, @TwcAppID = 'DC8E9FD3-21A0-4403-BC7B-A0F1016BBBF3';
SELECT 'Baron:', d.* FROM `data_source` d WHERE `app_guid` = @BaronAppID
UNION
SELECT 'TWC:', d.* FROM `data_source` d WHERE `app_guid` = @TwcAppID;
-- get the sourceID values for Baron and TWC readers
-- the customID is null phrase is used to select the specific instance if there is more than one - but could be a non-null value too
SET @BaronID = 0, @TWCID = 0;
SELECT `ID` INTO @BaronID FROM `data_source` WHERE `app_guid` = @BaronAppID and customID is null;
SELECT `ID` INTO @TWCID FROM `data_source` WHERE `app_guid` = @TwcAppID and customID is null;
SELECT @BaronID, @TWCID;
-- optional - check for code translations for Baron - should be 59 total
SELECT `iconCode`, `weatherId`, `shortText` FROM `weather_wsi_codes` WHERE `sourceID` = @BaronID;
/* switch the locations from TWC to Baron reader
update wsi_city
set sourceID = @BaronID
WHERE sourceID = @TWCID
;
update weather_city
set sourceID = @BaronID
WHERE sourceID = @TWCID
;
*/ |