From dbd4b3614d8db7f3475e598fdb3e9645cd9e4b82 Mon Sep 17 00:00:00 2001 From: Obeme228 Date: Wed, 9 Sep 2026 12:45:33 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20works/lab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- works/lab | 133 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 115 insertions(+), 18 deletions(-) diff --git a/works/lab b/works/lab index 7693361..57bc3be 100644 --- a/works/lab +++ b/works/lab @@ -2,24 +2,32 @@ Table card { card_id int [primary key,not null] card_name text [not null] card_hp int [not null, check: `card_hp > 0`] - card_hieght numeric - card_weight numeric - card_rarity text + card_hieght numeric [not null] + card_weight numeric [not null] + card_rarity text [not null] card_number text [not null] - card_artist text - card_release_date date - card_image_url text + card_artist text [not null] + card_release_date date [not null] + card_image_url text [not null] card_set_id int [not null, ref: > card_set.card_set_id] illustrator_id int [not null, ref: > illustrator.illustrator_id] card_pokemon_id int [not null] trainer_id int + indexes { + (card_set_id, card_number) [unique] + } } + + Table card_set { card_set_id int [primary key, not null] card_set_releaced_date date card_set_name text [not null, unique] card_set_code int [not null, unique] card_set_total_cards int [not null, unique] + card_set_release_date date [not null] + card_set_logo_url text [not null] + card_set_symbol_url text [not null] } Table attack { @@ -39,48 +47,137 @@ Table card_attack { Table energy_type { energy_quantily text [null] - element_type_id int [primary key, not null] - element_type_name text [not null, unique] + energy_type_id int [primary key, not null] + energy_type_name text [not null, unique] + energy_type_icon_url text [not null] } + Table illustrator { - illustrator_name text + illustrator_name text [not null] illustrator_id int [primary key, not null] illustrator_nationality text [null] } + Table attack_energy_cost { attack_energy_cost_id int [primary key] + cost_link_id int [not null] attack_id int [not null] element_type_id int [not null] - + cost_quantity int [not null] } Table pokemon { pokemon_id int [primary key,not null] pokemon_name text [not null] pokemon_hp int [not null, check: `card_hp > 0`] - pokemon_hieght numeric - pokemon_weight numeric - pokemon_rarity text + pokemon_hieght text [not null] + pokemon_weight text [not null] + pokemon_rarity text [not null] pokemon_number text [not null] - pokemon_artist text - pokemon_release_date date + pokemon_artist text [not null] + pokemon_release_date date [not null] energy_type_id int [not null] attack_energy_cost_id int [not null] attack_id int [not null] pokemon_rare text [not null] trainer_id int [not null] - card_pokemon_category text [not null] - card_pokemon_pokedex_id int + pokemon_category text [not null] + pokemon_pokedex_id int [not null] + pokemon_stage text [not null] + pokemon_evolves_from text [not null] + pokemon_retreat_cost int [not null] + pokemon_sub_type_id int [not null] + } + Table trainer { tranier_id int [primary key,not null] trainer_name text [not null, unique] - trainer_skill text [not null] + trainer_effect_text text [not null] trainer_specification text [not null] trainer_description text [not null] trainer_type text [not null] trainer_released_date date [not null] trainer_rare text [not null] + trainer_is_ace_spec logical [null, check: `trainer_is_ace_spec <= 1`] +} + +Table pokemon_sub_type { + syb_type_id int [not null, primary key] + syb_type_name text [not null, unique] + sub_type_default_prize_count int [not null,check: `sub_type_default_prize_count > 0`] + sub_type_global_rule_text text [not null] +} + +Table ability { + ability_type_id int [not null, primary key] + ability_type_name text [not null, unique] +} + +Table attack_name { + printed_type_id int [not null, primary key] + printed_type_name text [not null,unique] + +} + +Table game_mechanic { + mechanic_id int [not null, primary key] + mechanic_name text [not null, unique] +} + +Table pokemon_species { + species_pokedex_number int [not null,primary key] + species_eng_name text [not null,unique] + species_generation int [not null] + species_height_m float [not null] + species_weight_kg float [not null] +} + +Table pokedex_entry { + entry_id int [not null, primary key] + entry_pokedex_number int [not null] + entry_source_game text [not null] + entry_description text [not null] +} + +Table energy_card { + energy_card_id int [not null, primary key] + energy_is_special logical [not null] + energy_main_type_id int [not null] + energy_effect_text text [null] +} + +Table pokemon_ability { + ability_pokemon_card_id int [not null, primary key] + ability_type_id int [not null] + ability_name text [not null] + ability_effect_text text [not null] +} + +Table pokemon_attack_link { + link_id int [not null, primary key] + link_pokemon_card_id int [not null] + link_attack_name_id int [not null] + link_damage_value text [not null] + link_effect_text text [not null] + indexes { + (link_pokemon_card_id, link_attack_name_id) [unique] + } +} +Table pokemon_attribute { + attribute_id int [not null, primary key] + attribute_pokemon_card_id int [not null] + attribute_energy_type_id int [not null] + attribute_kind text [not null] + attribute_modifier_value text [not null] + indexes { + (attribute_pokemon_card_id, attribute_energy_type_id, attribute_kind) [unique] + } +} +Table trainer_mechanic_link { + mechanic_link_trainer_card_id int [not null] + mechanic_link_mechanic_id int [not null,ref:] + primary key (mechanic_link_trainer_card_id, mechanic_link_mechanic_id) }