diff options
-rwxr-xr-x | bin/import-rankings.sh | 2 | ||||
-rw-r--r-- | docs/db-structure.sql | 4 | ||||
-rw-r--r-- | scripts/pyranking/fetch.py | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/bin/import-rankings.sh b/bin/import-rankings.sh index d73af64..90ce6bc 100755 --- a/bin/import-rankings.sh +++ b/bin/import-rankings.sh @@ -7,7 +7,7 @@ REPLACE INTO TABLE temp_rankings FIELDS TERMINATED BY ','; INSERT INTO rankings ( - SELECT pid, \`date\`, place, score, region, flags + SELECT pid, \`date\`, place, score, region, flags, rank, club FROM temp_rankings JOIN players ON players.id = temp_rankings.pid diff --git a/docs/db-structure.sql b/docs/db-structure.sql index 56c0f0a..35fdc52 100644 --- a/docs/db-structure.sql +++ b/docs/db-structure.sql @@ -37,7 +37,9 @@ CREATE TABLE `rankings` ( `place` int(11) NOT NULL, `score` decimal(8,4) NOT NULL, `region` varchar(2) COLLATE utf8_unicode_520_ci NOT NULL, - `flags` varchar(2) COLLATE utf8_unicode_520_ci NOT NULL + `flags` varchar(2) COLLATE utf8_unicode_520_ci NOT NULL, + `rank` decimal(3,1) NOT NULL, + `club` varchar(100) COLLATE utf8_unicode_520_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_520_ci; -- -------------------------------------------------------- diff --git a/scripts/pyranking/fetch.py b/scripts/pyranking/fetch.py index 0d301d4..304f509 100644 --- a/scripts/pyranking/fetch.py +++ b/scripts/pyranking/fetch.py @@ -5,8 +5,8 @@ def fetch_ranking(date, assoc=False): rankings.place, rankings.pid, CONCAT(players.name, " ", players.surname) player, - players.rank, - rankings.region, players.club, + rankings.rank, + rankings.region, rankings.club, REPLACE(rankings.flags, "K", "") age, IF(rankings.flags LIKE 'K%', "K", "") gender, rankings.score |