Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ make docker-migrate
When you start PokéAPI with the above Docker Compose setup, an [Hasura Engine](https://github.com/hasura/graphql-engine) server is started as well. It's possible to track all the PokeAPI tables and foreign keys by simply

```sh
# hasura cli needs to be installed and available in your $PATH: https://hasura.io/docs/latest/graphql/core/hasura-cli/install-hasura-cli.html
# hasura cli needs to be installed and available in your $PATH: https://hasura.io/docs/2.0/hasura-cli/install-hasura-cli
# hasura cli's version has to greater than v2.48.1
make hasura-apply
```
Expand Down
31 changes: 30 additions & 1 deletion data/v2/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,18 @@ def csv_record_to_objects(info):


def _build_items():
def csv_record_to_objects(info):
yield Currency(id=int(info[0]), name=info[1])

build_generic((Currency,), "currencies.csv", csv_record_to_objects)

def csv_record_to_objects(info):
yield CurrencyName(
currency_id=int(info[0]), language_id=int(info[1]), name=info[2]
)

build_generic((CurrencyName,), "currency_names.csv", csv_record_to_objects)

def csv_record_to_objects(info):
yield ItemPocket(id=int(info[0]), name=info[1])

Expand Down Expand Up @@ -499,7 +511,6 @@ def csv_record_to_objects(info):
id=int(info[0]),
name=info[1],
item_category_id=int(info[2]),
cost=int(info[3]),
fling_power=int(info[4]) if info[4] != "" else None,
item_fling_effect_id=int(info[5]) if info[5] != "" else None,
)
Expand Down Expand Up @@ -544,6 +555,24 @@ def csv_record_to_objects(info):

build_generic((ItemGameIndex,), "item_game_indices.csv", csv_record_to_objects)

def csv_record_to_objects(info):
# Keep backward compatibility with 4-column files (no currency_id).
has_currency_id = len(info) >= 5
purchase_price_index = 3 if has_currency_id else 2
sell_price_index = 4 if has_currency_id else 3

yield ItemPrice(
item_id=int(info[0]),
version_group_id=int(info[1]),
currency_id=int(info[2]) if has_currency_id and info[2] else 1,
purchase_price=(
int(info[purchase_price_index]) if info[purchase_price_index] else None
),
sell_price=int(info[sell_price_index]) if info[sell_price_index] else None,
)

build_generic((ItemPrice,), "item_prices.csv", csv_record_to_objects)

def csv_record_to_objects(info):
yield ItemFlavorText(
item_id=int(info[0]),
Expand Down
20 changes: 20 additions & 0 deletions data/v2/csv/currencies.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
id,identifier
1,poke-dollar
2,coin
3,volcanic-ash
4,poke-coupon
5,berry-powder
6,battle-point
7,sphere
8,castle-point
9,watt
10,athlete-point
11,dream-point
12,dream-world-berry
13,poke-mile
14,festival-coin
15,poke-bean
16,home-point
17,merit-point
18,league-point
19,blueberry-point
20 changes: 20 additions & 0 deletions data/v2/csv/currency_names.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
id,language_id,name
1,9,Pokémon Dollar
2,9,Coin
3,9,Volcanic Ash
4,9,Poké Coupon
5,9,Berry Powder
6,9,Battle Point
7,9,Sphere
8,9,Castle Point
9,9,Watt
10,9,Athlete Point
11,9,Dream Point
12,9,Berry (Dream World)
13,9,Poké Mile
14,9,Festival Coin
15,9,Poké Bean
16,9,Pokémon HOME Point
17,9,Merit Point
18,9,League Point
19,9,Blueberry Point
292 changes: 292 additions & 0 deletions data/v2/csv/item_prices.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,292 @@
item_id,version_group_id,currency_id,purchase_price,sell_price
1,1,1,,0
1,2,1,,0
1,3,1,,0
1,4,1,,0
1,28,1,,0
1,29,1,,0
2,1,1,1200,600
2,2,1,1200,600
2,3,1,1200,600
2,4,1,1200,600
2,5,1,1200,600
2,6,1,1200,600
2,7,1,1200,600
2,8,1,1200,600
2,9,1,1200,600
2,10,1,1200,600
2,11,1,1200,600
2,14,1,1200,600
2,15,1,1200,600
2,16,1,1200,600
2,17,1,800,400
2,18,1,800,400
2,19,1,500,250
2,20,1,800,400
2,23,1,1200,600
2,24,1,600,150
2,25,1,800,200
2,28,1,1200,600
2,29,1,1200,600
2,30,1,600,150
3,1,1,600,300
3,2,1,600,300
3,3,1,600,300
3,4,1,600,300
3,5,1,600,300
3,6,1,600,300
3,7,1,600,300
3,8,1,600,300
3,9,1,600,300
3,10,1,600,300
3,11,1,600,300
3,14,1,600,300
3,15,1,600,300
3,16,1,600,300
3,17,1,600,300
3,18,1,600,300
3,19,1,300,150
3,20,1,600,300
3,23,1,600,300
3,24,1,300,75
3,25,1,600,150
3,28,1,600,300
3,29,1,600,300
3,30,1,300,75
6,5,1,1000,500
6,6,1,1000,500
6,7,1,1000,500
6,8,1,1000,500
6,9,1,1000,500
6,10,1,1000,500
6,11,1,1000,500
6,14,1,1000,500
6,15,1,1000,500
6,16,1,1000,500
6,17,1,1000,500
6,18,1,1000,500
6,20,1,1000,500
6,23,1,1000,500
6,25,1,1000,250
6,30,1,1000,250
7,5,1,1000,500
7,6,1,1000,500
7,7,1,,500
7,8,1,,500
7,9,1,,500
7,10,1,1000,500
7,11,1,1000,500
7,14,1,1000,500
7,15,1,1000,500
7,16,1,1000,500
7,17,1,1000,500
7,18,1,1000,500
7,20,1,1000,500
7,23,1,,500
7,25,1,1000,250
7,30,1,1000,250
8,5,1,1000,500
8,6,1,1000,500
8,7,1,1000,500
8,8,1,1000,500
8,9,1,1000,500
8,10,1,1000,500
8,11,1,1000,500
8,14,1,1000,500
8,15,1,1000,500
8,16,1,1000,500
8,17,1,1000,500
8,18,1,1000,500
8,20,1,1000,500
8,23,1,1000,500
8,25,1,1000,250
8,30,1,1000,250
9,5,1,1000,500
9,6,1,1000,500
9,7,1,1000,500
9,8,1,1000,500
9,9,1,1000,500
9,10,1,1000,500
9,11,1,1000,500
9,14,1,1000,500
9,15,1,1000,500
9,16,1,1000,500
9,17,1,1000,500
9,18,1,1000,500
9,20,1,1000,500
9,23,1,1000,500
9,25,1,1000,250
9,30,1,1000,250
10,5,1,1000,500
10,6,1,1000,500
10,7,1,1000,500
10,8,1,1000,500
10,9,1,1000,500
10,10,1,1000,500
10,11,1,1000,500
10,14,1,1000,500
10,15,1,1000,500
10,16,1,1000,500
10,17,1,1000,500
10,18,1,1000,500
10,20,1,1000,500
10,23,1,1000,500
10,25,1,1000,250
10,30,1,1000,250
11,5,1,1000,500
11,6,1,1000,500
11,7,1,1000,500
11,8,1,1000,500
11,9,1,1000,500
11,10,1,1000,500
11,11,1,1000,500
11,14,1,1000,500
11,15,1,1000,500
11,16,1,1000,500
11,17,1,1000,500
11,18,1,1000,500
11,20,1,3000,1500
11,23,1,1000,500
11,25,1,3000,750
11,30,1,3000,750
12,5,1,,100
12,6,1,,100
12,7,1,,100
12,8,1,,100
12,9,1,,100
12,10,1,,100
12,15,1,200,100
12,16,1,,100
12,17,1,,10
12,18,1,,10
12,19,1,,50
12,20,1,,10
12,23,1,,100
12,25,1,,5
12,30,1,200,50
13,8,1,1000,500
13,9,1,1000,500
13,10,1,1000,500
13,11,1,1000,500
13,14,1,1000,500
13,15,1,1000,500
13,16,1,1000,500
13,17,1,1000,500
13,18,1,1000,500
13,20,1,1000,500
13,23,1,1000,500
13,25,1,1000,250
13,30,1,1000,250
14,8,1,300,150
14,9,1,300,150
14,10,1,300,150
14,11,1,300,150
14,14,1,300,150
14,15,1,300,150
14,16,1,300,150
14,17,1,300,150
14,18,1,300,150
14,20,1,300,150
14,23,1,300,150
14,25,1,300,75
14,30,1,300,75
15,8,1,1000,500
15,9,1,1000,500
15,10,1,1000,500
15,11,1,1000,500
15,14,1,1000,500
15,15,1,1000,500
15,16,1,1000,500
15,17,1,1000,500
15,18,1,1000,500
15,20,1,1000,500
15,23,1,1000,500
15,25,1,1000,250
15,30,1,1000,250
305,1,1,3000,1500
305,2,1,3000,1500
305,3,1,,1500
305,4,1,,1500
305,5,1,,1500
305,6,1,,1500
305,7,1,,1500
305,16,1,5000,
305,20,1,40000,
305,23,1,,1500
305,25,1,,400
305,28,1,3000,1500
305,29,1,3000,1500
306,1,1,2000,1000
306,2,1,2000,1000
306,3,1,2000,1000
306,4,1,2000,1000
306,5,1,,1500
306,6,1,,1500
306,7,1,,1500
306,8,1,,1500
306,9,1,,1500
306,10,1,,1500
306,12,1,,1500
306,13,1,,1500
306,23,1,,1500
306,25,1,,400
449,3,1,,150
449,4,1,,150
449,10,1,,150
449,11,1,,150
449,14,1,,150
449,15,1,,150
449,16,1,,150
450,3,1,,150
450,4,1,,150
450,10,1,,150
450,11,1,,150
450,14,1,,150
450,15,1,,150
450,16,1,,150
451,3,1,,150
451,4,1,,150
451,10,1,,150
451,11,1,,150
451,14,1,,150
451,15,1,,150
451,16,1,,150
452,3,1,,150
452,4,1,,150
452,10,1,,150
452,11,1,,150
452,14,1,,150
452,15,1,,150
452,16,1,,150
452,24,1,120,30
453,3,1,,150
453,4,1,,150
453,10,1,,150
453,11,1,,150
453,14,1,,150
453,15,1,,150
453,16,1,,150
454,3,1,,150
454,4,1,,150
454,10,1,,150
454,11,1,,150
454,14,1,,150
454,15,1,,150
454,16,1,,150
455,3,1,,150
455,4,1,,150
455,10,1,,150
455,11,1,,150
455,14,1,,150
455,15,1,,150
455,16,1,,150
457,10,1,,150
457,11,1,,150
457,14,1,,150
457,15,1,,150
457,16,1,,150
457,17,1,,150
457,18,1,,150
457,19,1,,150
457,20,1,,150
887,18,1,1000,
Loading
Loading