generated from admin/template
74 lines
2.2 KiB
Plaintext
74 lines
2.2 KiB
Plaintext
table card {
|
|
card_name text [not null]
|
|
card_hp int [not null, check: `card_hp > 0`]
|
|
card_rarity text [null]
|
|
card_id int [pk, increment]
|
|
card_number text [not null]
|
|
card_artist text [null]
|
|
card_release_date date [null]
|
|
card_inge_url text [null]
|
|
illustrator_id text [not null, ref: > illustrator.illustrator_id]
|
|
card_set_id int [not null, ref: > card_set.card_set_id]
|
|
}
|
|
|
|
table card_set {
|
|
set_name text [not null, unique]
|
|
set_relaced_date date [null]
|
|
set_code int [not null, unique]
|
|
set_total_cards int [null, check: `set_total_cards > 0` ]
|
|
card_set_id int [not null, increment]
|
|
}
|
|
table pockemon {
|
|
pockemon_name text [not null]
|
|
pockemon_id int [pk, increment]
|
|
pockemon_hp int [not null, check: `pockemon_hp > 0`]
|
|
pockemon_release_date date [null]
|
|
pockemon_inge_url text [null]
|
|
pockemon_base_attack int [null, check: `pockemon_base_attack > 0`]
|
|
|
|
}
|
|
table attack {
|
|
attack_name text [not null]
|
|
attack_base_damage int [null, check: `attack_base_damge >= 0`]
|
|
attack_id int [pk, increment]
|
|
attack_decription text [null]
|
|
attack_retreat_cost int [null, check: `attack_retreat_cost >=0`]
|
|
}
|
|
|
|
table element_type {
|
|
element_type_name text [not null, unique]
|
|
element_type_id int [pk, increment]
|
|
element_type_symbol text [null]
|
|
}
|
|
|
|
table illustrator {
|
|
illustrator_name text [not null, unique]
|
|
illustrator_id int [pk, increment]
|
|
illustrator_nationality text [null]
|
|
illustrator_website text [null]
|
|
}
|
|
|
|
table card_attack {
|
|
card_id int [not null, ref: > card.card_id ]
|
|
card_attack_id int [pk, increment]
|
|
attack_id int [not null, ref: > attack.attack_id]
|
|
card_attack_position int [not null, check: `card_attack_position > 0`]
|
|
}
|
|
|
|
table attack_energy_cost {
|
|
attack_energy_cost_id int [pk, increment]
|
|
attack_id int [not null, ref: > attack.attack_id]
|
|
element_type_id int [not null, ref: >element_type.element_type_id]
|
|
energy_quality int [not null, check: `energy_quality > 0`]
|
|
}
|
|
|
|
|
|
|
|
Ref: "pockemon"."pockemon_id" <? "card"."card_id"
|
|
|
|
Ref: "pockemon"."pockemon_id" <? "pockemon"."pockemon_name"
|
|
Ref: "attack"."attack_base_damage"<?"pockemon"."pockemon_base_attack"
|
|
Ref: "attack"."attack_retreat_cost"<?"pockemon"."pockemon_base_attack"
|
|
Ref: "card"."card_name" <> "pockemon"."pockemon_name"
|
|
|
|
Ref: "card"."card_hp" <> "pockemon"."pockemon_hp" |