diff --git a/works/28.09.finalDbRef(DBio) b/works/28.09.finalDbRef(DBio) new file mode 100644 index 0000000..cc83ba6 --- /dev/null +++ b/works/28.09.finalDbRef(DBio) @@ -0,0 +1,144 @@ +Table card_type { + type_id int [pk] + type_name text [not null, unique] +} + +Table card_set { + set_id int [pk] + set_name text [not null] + set_code text [not null, unique] + set_series text + set_total_cards int + set_release_date date + set_logo_url text + set_symbol_url text +} + +Table card { + card_id int [pk] + card_number text [not null] + card_set_id int [ref: > card_set.set_id] + card_name text + card_rarity text + card_type_id int [ref: > card_type.type_id] + card_image_url text +} + +Table energy_type { + energy_type_id int [pk] + energy_type_name text + energy_type_icon_url text +} + +Table pokemon_sub_type { + sub_type_id int [pk] + sub_type_name text + sub_type_default_prize_count int + sub_type_global_rule_text text +} + +Table ability_type { + ability_type_id int [pk] + ability_type_name text +} + +Table trainer_printed_type { + printed_type_id int [pk] + printed_type_name text +} + +Table game_mechanic { + mechanic_id int [pk] + mechanic_name text +} + +Table pokemon_species { + species_pokedex_number int [pk] + species_eng_name text + species_generation int + species_height_m float + species_weight_kg float +} + +Table pokedex_entry { + entry_id int [pk] + entry_pokedex_number int [ref: > pokemon_species.species_pokedex_number] + entry_source_game text + entry_description text +} + +Table trainer_card { + trainer_card_id int [pk, ref: > card.card_id] + trainer_printed_type_id int [ref: > trainer_printed_type.printed_type_id] + trainer_effect_text text + trainer_is_ace_spec bool +} + +Table energy_card { + energy_card_id int [pk, ref: > card.card_id] + energy_is_special bool + energy_main_type_id int [ref: > energy_type.energy_type_id] + energy_effect_text text +} + +Table pokemon_card { + pokemon_card_id int [pk, ref: > card.card_id] + pokemon_pokedex_entry_id int [ref: > pokedex_entry.entry_id] + pokemon_hp int + pokemon_stage text + pokemon_evolves_from text + pokemon_retreat_cost int + pokemon_sub_type_id int [ref: > pokemon_sub_type.sub_type_id] + pokemon_category text + pokemon_printed_height text + pokemon_printed_weight text +} + +Table pokemon_ability { + ability_id int [pk] + ability_pokemon_card_id int [ref: > pokemon_card.pokemon_card_id] + ability_type_id int [ref: > ability_type.ability_type_id] + ability_name text + ability_effect_text text + + indexes { + (ability_pokemon_card_id, ability_name) [unique] + } +} + +Table attack_name { + attack_name_id int [pk] + attack_name_title text [not null, unique] +} + +Table pokemon_attack_link { + link_id int [pk] + link_pokemon_card_id int [ref: > pokemon_card.pokemon_card_id] + link_attack_name_id int [ref: > attack_name.attack_name_id] + link_damage_value text + link_effect_text text +} + +Table attack_energy_cost { + cost_id int [pk] + cost_link_id int [ref: > pokemon_attack_link.link_id] + cost_energy_type_id int [ref: > energy_type.energy_type_id] + cost_quantity int +} + +Table pokemon_attribute { + attribute_id int [pk] + attribute_pokemon_card_id int [ref: > pokemon_card.pokemon_card_id] + attribute_energy_type_id int [ref: > energy_type.energy_type_id] + attribute_kind text + attribute_modifier_value text +} + +Table trainer_mechanic_link { + mechanic_link_trainer_card_id int [ref: > trainer_card.trainer_card_id] + mechanic_link_mechanic_id int [ref: > game_mechanic.mechanic_id] + + indexes { + (mechanic_link_trainer_card_id, mechanic_link_mechanic_id) [pk] + } +} \ No newline at end of file