Skip to content

Commit d9dda14

Browse files
committed
Add object relationships for region and base form required in Pokemon evolution metadata
- Updated v1beta and v1beta2 YAML files to include new foreign key constraints for region_restriction_id and base_form_required_id. - Enhanced EvolutionChainDetailSerializer to include region_restriction and base_form_required properties with appropriate schema definitions.
1 parent 69ab177 commit d9dda14

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

graphql/v1beta/metadata/databases/default/tables/public_pokemon_v2_pokemonevolution.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ object_relationships:
3535
- name: pokemon_v2_type
3636
using:
3737
foreign_key_constraint_on: known_move_type_id
38+
- name: pokemon_v2_region
39+
using:
40+
foreign_key_constraint_on: region_restriction_id
41+
- name: pokemon_v2_pokemonspecy_by_base_form_required
42+
using:
43+
foreign_key_constraint_on: base_form_required_id
3844
select_permissions:
3945
- role: anon
4046
permission:

graphql/v1beta2/metadata/databases/default/tables/public_pokemon_v2_pokemonevolution.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ object_relationships:
4040
- name: type
4141
using:
4242
foreign_key_constraint_on: known_move_type_id
43+
- name: region
44+
using:
45+
foreign_key_constraint_on: region_restriction_id
46+
- name: baseformrequired
47+
using:
48+
foreign_key_constraint_on: base_form_required_id
4349
select_permissions:
4450
- role: anon
4551
permission:

pokemon_v2/serializers.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5596,6 +5596,8 @@ class Meta:
55965596
"trade_species",
55975597
"trigger",
55985598
"turn_upside_down",
5599+
"region_restriction",
5600+
"base_form_required",
55995601
],
56005602
"properties": {
56015603
"gender": {
@@ -5724,6 +5726,24 @@ class Meta:
57245726
},
57255727
},
57265728
"turn_upside_down": {"type": "boolean"},
5729+
"region_restriction": {
5730+
"type": "object",
5731+
"nullable": True,
5732+
"required": ["name", "url"],
5733+
"properties": {
5734+
"name": {"type": "string"},
5735+
"url": {"type": "string", "format": "uri"}
5736+
}
5737+
},
5738+
"base_form_required": {
5739+
"type": "object",
5740+
"nullable": True,
5741+
"required": ["name", "url"],
5742+
"properties": {
5743+
"name": {"type": "string"},
5744+
"url": {"type": "string", "format": "uri"}
5745+
}
5746+
},
57275747
},
57285748
},
57295749
},

0 commit comments

Comments
 (0)