|
Minors (Single A)
Join Date: May 2004
Posts: 74
|
Bug in SQL Exports for Trade History
Our league recently just upgraded to OOTP 20 and we noticed that the SQL exports have changed for the trade_history.mysql.sql file. The change was made to incorporate the way draft picks are now handled by adding in the team the draft pick came from. The problem is it looks like the export function was not updated correctly and bad data is getting put into this file.
Examples (my apologies for the ugliness of this)
This is an export from OOTP18:
("2026-5-10", "The <Niagara Mariners:team#17> trade 27-year-old starting pitcher <Earl Alison: player#8817>, 26-year-old second baseman <Linus Story: player#8473> and a 6th round draft pick to the <Peterborough Stars:team#27> for 26-year-old starting pitcher <Josh Brann: p...", 31026, 17, 8817, 6, 8473, 0, 0, 0, 0, 0, 0, 0, 0, 27, 7876, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0)
Note the 6 and the 5 in the last part, those are the draft picks being traded.
This is an export from OOTP20:
("2027-11-4", "The <Niagara Mariners:team#17> trade 27-year-old starting pitcher <Josh Brann: player#7876>, 25-year-old starting pitcher <Garwood Bale: player#10374>, 27-year-old left fielder <Sergeant Chavez: player#7955> and a 15th round draft pick to the <Sault Ste. Mar", 36196, 17, 7876, 17, NULL, 10374, 0, NULL, 7955, 0, NULL, 0, 0, NULL, 0, 0, NULL, 0, 1, 8859, 0, NULL, 0, 0, NULL, 0, 0, NULL, 0, 0, NULL, 0, 0, NULL, 0);
Note the 17 and NULL after the 7876, this is the 15th round draft pick that was traded. The team id of the draft pick that was traded was 17 and is being put into the draft_round_0_0 field and not the draft_team_0_0 as it should be. The SQL below shows what fields line up with which fields in the above statements.
OOTP18 CREATE SQL Statement
CREATE TABLE IF NOT EXISTS `trade_history` (`date` DATE, `summary` VARCHAR(255), `message_id` INT, `team_id_0` INT, `player_id_0_0` INT, `draft_round_0_0` INT, `player_id_0_1` INT, `draft_round_0_1` INT, `player_id_0_2` INT, `draft_round_0_2` INT, `player_id_0_3` INT, `draft_round_0_3` INT, `player_id_0_4` INT, `draft_round_0_4` INT, `cash_0` INT, `team_id_1` INT, `player_id_1_0` INT, `draft_round_1_0` INT, `player_id_1_1` INT, `draft_round_1_1` INT, `player_id_1_2` INT, `draft_round_1_2` INT, `player_id_1_3` INT, `draft_round_1_3` INT, `player_id_1_4` INT, `draft_round_1_4` INT, `cash_1` INT);
OOTP20 CREATE SQL Statement
CREATE TABLE IF NOT EXISTS `trade_history` (`date` DATE, `summary` VARCHAR(255), `message_id` INT, `team_id_0` INT, `player_id_0_0` INT, `draft_round_0_0` SMALLINT, `draft_team_0_0` INT, `player_id_0_1` INT, `draft_round_0_1` SMALLINT, `draft_team_0_1` INT, `player_id_0_2` INT, `draft_round_0_2` SMALLINT, `draft_team_0_2` INT, `player_id_0_3` INT, `draft_round_0_3` SMALLINT, `draft_team_0_3` INT, `player_id_0_4` INT, `draft_round_0_4` SMALLINT, `draft_team_0_4` INT, `cash_0` INT, `team_id_1` INT, `player_id_1_0` INT, `draft_round_1_0` SMALLINT, `draft_team_1_0` INT, `player_id_1_1` INT, `draft_round_1_1` SMALLINT, `draft_team_1_1` INT, `player_id_1_2` INT, `draft_round_1_2` SMALLINT, `draft_team_1_2` INT, `player_id_1_3` INT, `draft_round_1_3` SMALLINT, `draft_team_1_3` INT, `player_id_1_4` INT, `draft_round_1_4` SMALLINT, `draft_team_1_4` INT, `cash_1` INT);
Please look into this bug as it is very annoying to not have the correct draft rounds coming out of the SQL. A couple of our features on our website no longer work as intended due to this.
Please let me know if you require any further information. I haven't posted my league files as I don't believe they are necessary, if you look at your SQL export for the trade_history.mysql.sql file you will see that they don't line up properly I am sure of it.
Last edited by Subliminal; 11-14-2019 at 01:44 PM.
|