Great to hear about the upcoming release. I hope you'll look at the AW inconsistencies, especially at Lingfield on days when they run a mix of turf and AW which really seems to throw a spanner in the works. I have a script that pretty much sorts out the main inconsistencies with the exception of the Lingfield mixed track meetings. I hope you'll find this useful - it took some pretty detailed analysis and checking against an independent data source ... whoops I just noticed this is outdated because of reference to Great Leighs rather than the now Chelmsford City. Anyway you can still see from this what needs fixing up ...
USE smartform;
SET SQL_SAFE_UPDATES = 0;
# Correct flat races incorrectly tagged as all weather (count=24 on 17 July 2016)
UPDATE historic_races
SET race_type = "Flat", race_type_id = 12, all_weather = 0
WHERE race_type_id = 15
AND going NOT IN ("Slow", "Standard", "Standard to Fast", "Standard to Slow")
AND course NOT IN ("Dundalk", "Kempton", "Lingfield", "Southwell", "Wolverhampton");
# Correct all weather races incorrectly tagged with flat going (count=412 on 17 July 2016)
UPDATE historic_races
SET going = "Standard", all_weather = 1
WHERE race_type_id = 15
AND going NOT IN ("Slow", "Standard", "Standard to Fast", "Standard to Slow");
# Correct all weather races (excluding Lingfield) incorrectly tagged as flat (count=180 om 17 July 2016)
UPDATE historic_races
SET race_type = "All Weather Flat", race_type_id = 15, all_weather = 1
WHERE race_type_id = 12
AND going IN ("Slow", "Standard", "Standard to Fast", "Standard to Slow")
AND course IN ("Dundalk", "Great_Leighs", "Kempton", "Laytown", "Newcastle", "Southwell", "Wolverhampton");
# Correct Lingfield races that are incorrectly tagged. Note Lingfield often holds meetings with a combination of flat and all weather flat races
# Argh cannot do these without correct data on the individual races.
# There are 458 Lingfirld races with race_type_id = 12 and going = Standard.
# Some of these should be Flat, some should be All Weather Flat. Original confusion looks to have been mixed meetings.
# I looked at the all_weather flag - sometimes right sometimes wrong seemingly with no reliable pattern.
SET SQL_SAFE_UPDATES = 1;