generated from admin/template
Обновить works/sqllab1
This commit is contained in:
+95
-40
@@ -1,48 +1,66 @@
|
|||||||
Table card {
|
Table card {
|
||||||
card_id int [pk,not null]
|
card_id int [primary key,not null]
|
||||||
card_name text [not null]
|
card_name text [not null]
|
||||||
card_rarity text
|
card_rarity text
|
||||||
card_number text [not null]
|
card_number text [not null]
|
||||||
card_artist text
|
card_artist text
|
||||||
card_release_date date
|
card_release_date date
|
||||||
card_image_url text
|
card_image_url text
|
||||||
|
card_type text [not null]
|
||||||
|
indexes {
|
||||||
|
(card_set_id, card_number) [unique]
|
||||||
|
}
|
||||||
card_set_id int [not null, ref: > card_set.card_set_id]
|
card_set_id int [not null, ref: > card_set.card_set_id]
|
||||||
illustrator_id int [not null, ref: > illustrator.illustrator_id]
|
illustrator_id int [not null, ref: > illustrator.illustrator_id]
|
||||||
card_pokemon_id int [not null, ref: > card_pokemon.card_pokemon_id]
|
card_pokemon_id int [not null, ref: - card_pokemon.card_pokemon_id]
|
||||||
attack_energy_cost_id int [not null, ref: > attack_energy_cost.attack_energy_cost_id]
|
attack_energy_cost_id int [not null, ref: > attack_energy_cost.attack_energy_cost_id]
|
||||||
energy_type_id int [not null, ref: > energy_type.element_type_id]
|
energy_type_id int [not null, ref: > energy_type.element_type_id]
|
||||||
coach_id int [not null, ref: > coach.coach_id]
|
coach_id int [not null, ref: > coach.coach_id]
|
||||||
}
|
}
|
||||||
|
|
||||||
Table card_pokemon {
|
Table card_pokemon {
|
||||||
card_pokemon_id int [pk, not null]
|
card_pokemon_id int [primary key, not null]
|
||||||
card_pokemon_hp int [not null, check: `card_hp > 0`]
|
card_pokemon_hp int [not null, check: `card_hp > 0`]
|
||||||
card_pokemon_hieght numeric
|
card_pokemon_hieght numeric
|
||||||
card_pokemon_weight numeric
|
card_pokemon_weight numeric
|
||||||
card_pokemon_name text [not null]
|
card_pokemon_name text [not null]
|
||||||
card_card_id int [pk, not null]
|
card_pokemon_pokedex_entry_id int [not null]
|
||||||
|
card_card_id int [primary key, not null]
|
||||||
card_pokemon_stage text [not null]
|
card_pokemon_stage text [not null]
|
||||||
card_pokemon_evloves_from text
|
card_pokemon_evloves_from text
|
||||||
card_pokemon_category text
|
card_pokemon_category text [not null]
|
||||||
entrgy_type_id int [not null, ref: > energy_type.energy_type_id]
|
entrgy_type_id int [not null, ref: > energy_type.energy_type_id]
|
||||||
attack_energy_cost_id int [not null, ref: > attack_energy_cost.attack_energy_cost_id]
|
attack_energy_cost_id int [not null, ref: > attack_energy_cost.attack_energy_cost_id]
|
||||||
attack_id int [not null, ref: > attack.attack_id]
|
attack_id int [not null, ref: > attack.attack_id]
|
||||||
coach_id int [not null, ref: > coach.coach_id]
|
coach_id int [not null, ref: > coach.coach_id]
|
||||||
|
card_pokemon_pokedex_number int [null]
|
||||||
|
card_pokemon_retreat_cost int [not null]
|
||||||
|
card_pokemon_printed_height text [not null]
|
||||||
|
card_pokemon_printed_weight text [not null]
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Table pokemon_sub_type {
|
||||||
|
pokemon_sub_type_id int [primary key, not null]
|
||||||
|
pokemon_sub_type_name text [not null]
|
||||||
|
pokemon_sub_type_default_prize_count int [not null]
|
||||||
|
pokemon_sub_type_global_rule_text text [not null]
|
||||||
}
|
}
|
||||||
|
|
||||||
Table card_set {
|
Table card_set {
|
||||||
card_set_id int [pk, not null]
|
card_set_id int [primary key, not null]
|
||||||
card_set_releaced_date date
|
card_set_releaced_date date
|
||||||
card_set_name text [not null, unique]
|
card_set_name text [not null, unique]
|
||||||
card_set_code int [not null, unique]
|
card_set_code int [not null, unique]
|
||||||
card_set_total_cards int [not null, unique]
|
card_set_total_cards int [not null, unique]
|
||||||
card_set_series text [not null]
|
card_set_series text [not null]
|
||||||
|
card_total_cards int [not null]
|
||||||
card_set_logo_url text [not null]
|
card_set_logo_url text [not null]
|
||||||
card_set_symbol_url text [not null]
|
card_set_symbol_url text [not null]
|
||||||
}
|
}
|
||||||
|
|
||||||
Table attack {
|
Table attack {
|
||||||
attack_id int [pk, not null]
|
attack_id int [primary key, not null]
|
||||||
attack_name text [not null]
|
attack_name text [not null]
|
||||||
attack_base_damage text [null, check: `attack_base_damege >= 0`]
|
attack_base_damage text [null, check: `attack_base_damege >= 0`]
|
||||||
attack_effect text
|
attack_effect text
|
||||||
@@ -50,7 +68,7 @@ Table attack {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Table card_attack {
|
Table card_attack {
|
||||||
card_attack_id int [pk]
|
card_attack_id int [primary key]
|
||||||
card_id int [not null, ref: > card.card_id]
|
card_id int [not null, ref: > card.card_id]
|
||||||
attack_id int [not null, ref: > attack.attack_id]
|
attack_id int [not null, ref: > attack.attack_id]
|
||||||
card_attack_position int [null, check: `card_attack_position > 0`]
|
card_attack_position int [null, check: `card_attack_position > 0`]
|
||||||
@@ -58,10 +76,10 @@ Table card_attack {
|
|||||||
|
|
||||||
Table energy_type {
|
Table energy_type {
|
||||||
energy_quantily text [null]
|
energy_quantily text [null]
|
||||||
element_type_id int [ pk, not null]
|
element_type_id int [primary key, not null]
|
||||||
element_type_name text [not null, unique]
|
element_type_name text [not null, unique]
|
||||||
energy_type_id int [not null, pk]
|
energy_type_id int [not null, primary key]
|
||||||
energy_type_name text [not null, unique]
|
energy_type_icon_url text [not null]
|
||||||
}
|
}
|
||||||
|
|
||||||
Table illustrator {
|
Table illustrator {
|
||||||
@@ -72,11 +90,10 @@ Table illustrator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Table attack_energy_cost {
|
Table attack_energy_cost {
|
||||||
attack_energy_cost_id int [pk]
|
attack_energy_cost_id int [primary key]
|
||||||
attack_id int [not null]
|
attack_id int [not null]
|
||||||
element_type_id int [not null]
|
element_type_id int [not null]
|
||||||
}
|
}
|
||||||
|
|
||||||
Table coach {
|
Table coach {
|
||||||
coach_id int [primary key, not null]
|
coach_id int [primary key, not null]
|
||||||
coach_name text [not null, unique]
|
coach_name text [not null, unique]
|
||||||
@@ -86,48 +103,86 @@ Table coach {
|
|||||||
coach_description text [not null]
|
coach_description text [not null]
|
||||||
coach_rarity text [not null]
|
coach_rarity text [not null]
|
||||||
coach_image_url text [not null]
|
coach_image_url text [not null]
|
||||||
}
|
coach_printed_type_id int [not null]
|
||||||
|
coach_effect_text text [not null]
|
||||||
Table pockemon_sub_type {
|
coach_is_ace_spec boolean [not null]
|
||||||
pockemon_sub_type_id int [pk, not null]
|
|
||||||
pockemon_sub_type_name text [not null, unique]
|
|
||||||
pockemon_sub_type_default_prize_count int [not null]
|
|
||||||
pockemon_sub_type_global_rule_text text [not null]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Table ability_type {
|
Table ability_type {
|
||||||
ability_type_id int [pk, not null]
|
ability_type_id int [primary key, not null]
|
||||||
ability_type_name text [not null, unique]
|
ability_type_name text [not null]
|
||||||
}
|
}
|
||||||
|
|
||||||
Table attack_name {
|
Table attack_name {
|
||||||
attack_name_id int [pk, not null]
|
attack_name_id int [primary key, not null]
|
||||||
attack_name_title text [not null, unique]
|
attack_name_title text [not null]
|
||||||
}
|
}
|
||||||
|
|
||||||
Table coach_printed_type {
|
Table trainer_printed_type{
|
||||||
printed_type_id int [not null, pk]
|
trainer_prinded_type_id int [primary key, not null]
|
||||||
printed_type_name text [not null, unique]
|
trainer_printed_type_name text [not null]
|
||||||
}
|
}
|
||||||
|
|
||||||
Table game_mechanic {
|
Table game_mechanic {
|
||||||
mechanic_id int [not null, pk]
|
mechanic_id int [primary key, not null]
|
||||||
mechanic_name text [not null, unique]
|
mechenic_name text [not null]
|
||||||
}
|
}
|
||||||
|
|
||||||
Table pockemon_species {
|
Table pokemon_species {
|
||||||
species_pockemon_number int [not null, pk]
|
pokemon_species_pokedex_number int [not null]
|
||||||
species_eng_name text [not null, unique]
|
pokemon_species_end_name text [not null]
|
||||||
species_generation int [not null]
|
pokemon_species_generetion int [not null]
|
||||||
species_height_m float [not null]
|
pokemon_species_height_m float [not null]
|
||||||
species_weight_kg float [not null]
|
pokemon_species_weight_kg float [not null]
|
||||||
}
|
}
|
||||||
|
|
||||||
Table pokedex_entry {
|
Table pokedex_entry {
|
||||||
entry_id int [not null, pk]
|
pokedex_entry_id int [not null]
|
||||||
entry_pokedex_number int [not null]
|
pokedex_entry_pokedex_number int [not null]
|
||||||
entry_source_game text [not null]
|
pokedex_entry_source_game text [not null]
|
||||||
entry_description text [not null]
|
pokedex_entry_description text [not null]
|
||||||
}
|
}
|
||||||
|
|
||||||
Table
|
Table energy_card {
|
||||||
|
energy_card_id int [not null, primary key]
|
||||||
|
energy_is_special boolean [not null]
|
||||||
|
energy_main_type_id int [null]
|
||||||
|
energy_effect_text text [null]
|
||||||
|
}
|
||||||
|
|
||||||
|
Table pokemon_ability {
|
||||||
|
ability_pokemon_card_id int [not null]
|
||||||
|
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]
|
||||||
|
link_pokemon_card_id int [not null]
|
||||||
|
link_attack_name_id int [not null]
|
||||||
|
link_damage_value text [not null]
|
||||||
|
link_effect_text text [null]
|
||||||
|
indexes {
|
||||||
|
(link_pokemon_card_id, link_attack_name_id) [unique]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Table pokemon_attribute {
|
||||||
|
attribute_id int [not null]
|
||||||
|
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]
|
||||||
|
primery key (mechanic_link_trainer_card_id, mechanic_link_mechanic_id)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user