Skip to content

Commit

Permalink
Player name fixup, github actions converts data to JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
tobijdc committed Feb 6, 2024
1 parent 0034a09 commit b03f611
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/aligulac-import.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- name: Install postgres client
run: sudo apt-get install -y postgresql-client
run: sudo apt-get install -y postgresql-client yq
- name: Postgres client version
run: psql --version
- name: Check out repository code
Expand All @@ -35,8 +35,12 @@ jobs:
run: PGPASSWORD=postgres psql -h localhost -p 5432 -d postgres -U postgres -f db_import/data-fixup.sql
- name: Export player data
run: PGPASSWORD=postgres psql -h localhost -p 5432 -d postgres -U postgres -t -A -F"," -f db_import/top500-earnings.sql > result.csv
- name: Display Result
- name: Display CSV
run: cat result.csv
- name: Convert to JSON
run: yq result.csv -p=csv -o=json > players.json
- name: Display JSON
run: cat players.json
#- name: Commit changes
# run: |
# git config --global user.name 'GH Action Bot'
Expand Down
41 changes: 38 additions & 3 deletions db_import/data-fixup.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
BEGIN;

-- fix two Rain
UPDATE public.player
SET tag = 'Rain (P)'
WHERE player.id = 7;

UPDATE public.player
SET tag = 'Rain (T)'
WHERE player.id = 104;

-- fix two Happy
UPDATE public.player
SET tag = 'Happy (RU)'
WHERE player.id = 95;

UPDATE public.player
SET tag = 'Happy (KR)'
WHERE player.id = 40;

-- fix two Check
UPDATE public.player
SET tag = 'Check (1993)'
WHERE player.id = 1663;

UPDATE public.player
SET tag = 'Check (1986)'
WHERE player.id = 166;

-- fix two Bunny
UPDATE public.player
SET tag = 'Bunny (KR)'
WHERE player.id = 1517;

UPDATE public.player
SET tag = 'Bunny (DK)'
WHERE player.id = 1813;


-- fix MaxPax birthday (2004-07)
-- https://liquipedia.net/starcraft2/MaxPax
UPDATE public.player
Expand Down Expand Up @@ -80,6 +117,4 @@ UPDATE public.player
SET birthday = '1996-02-27'
WHERE player.id = 2453;



COMMIT;
COMMIT;

0 comments on commit b03f611

Please sign in to comment.