diff --git a/shema b/shema index 9a3e241..e585662 100644 --- a/shema +++ b/shema @@ -7,6 +7,12 @@ create table card_set ( set_release_date DATE not null ); +INSERT INTO card_set ( + set_name, set_code, set_series, + set_total_cards, set_release_date, + set_logo_url, set_symbol_url +); + INSERT INTO card_set (set_name, set_id, set_series, set_total_cards, set_release_date) VALUES ('XY Базовый набор', 'XY1', 'XY', 146, '2014-02-05', NULL, NULL), ('XY Огненная вспышка', 'XY2', 'XY', 106, '2014-05-07', NULL, NULL), @@ -19,12 +25,6 @@ INSERT INTO card_set (set_name, set_id, set_series, set_total_cards, set_release ('XY Тайное превосходство', 'XY9', 'XY', 122, '2016-02-03', NULL, NULL), ('XY Столкновение судеб', 'XY10', 'XY', 124, '2016-05-02', NULL, NULL); -INSERT INTO card_set ( - set_name, set_code, set_series, - set_total_cards, set_release_date, - set_logo_url, set_symbol_url -); - create table card ( card_id INT generated always as identity primary key, card_name TEXT not null, @@ -50,6 +50,27 @@ create table pokemon_card ( pokemon_printed_weight TEXT ); +INSERT INTO pokemon_card ( + pokemon_card_id, + pokemon_pokedex_number, + pokemon_pokedex_entry_id, + pokemon_hp, + pokemon_stage, + pokemon_evolves_from, + pokemon_retreat_cost, + pokemon_sub_type_id, + pokemon_category, + pokemon_printed_height, + pokemon_printed_weight +) VALUES + (28, 25, NULL, 60, 'Basic', NULL, 1, 1, 'Мышонок', '0.4 м', '6.0 кг'); + +create table energy_type ( + energy_type_id INT generated always as identity primary key, + energy_type_name text unique not null, + energy_type_icon_url text +); + INSERT INTO energy_type (energy_type_name, energy_type_icon_url) VALUES ('Grass',NULL), ('Fire',NULL), @@ -63,11 +84,6 @@ INSERT INTO energy_type (energy_type_name, energy_type_icon_url) VALUES ('Dragon',NULL), ('Colorless',NULL); -create table energy_type ( - energy_type_id INT generated always as identity primary key, - energy_type_name text unique not null, - energy_type_icon_url text -); create table pokemon_sub_type ( sub_type_id INT generated always as identity primary key, @@ -130,10 +146,7 @@ create table pokemon_species ( species_weigth_m NUMERIC ); -INSERT INTO pokemon_species ( - pokemon_pokedex_number, species_eng_name, - species_generation, species_height_m, species_weight_kg -) VALUES +INSERT INTO pokemon_species (pokemon_pokedex_number, species_eng_name, species_generation, species_height_m, species_weight_kg) VALUES (25, 'Pikachu', 1, 0.4, 6.0), (26, 'Raichu', 1, 0.8, 30.0), (448, 'Lucario', 4, 1.2, 54.0); @@ -152,6 +165,12 @@ create table trainer_card ( trainer_is_ace_spec BOOLEAN not null default false ); +INSERT INTO trainer_card ( + trainer_card_id, trainer_printed_type_id, + trainer_effect_text, trainer_is_ace_spec +) VALUES + (88, 2, 'Switch your Active Pokémon with 1 of your Benched Pokémon.', FALSE); + create table energy_card ( energy_card_id INT generated always as identity primary key references card(card_id) on delete cascade, energy_is_special BOOLEAN not null default false, @@ -159,6 +178,12 @@ create table energy_card ( energy_effect_text TEXT ); +INSERT INTO energy_card ( + energy_card_id, energy_is_special, + energy_main_type_id, energy_effect_text +) VALUES + (103, TRUE, NULL, 'This card provides 1 Fighting energy. When attached, ...'); + create table pokemon_ability ( ability_pokemon_card_id INT generated always as identity primary key references pokemon_card(pokemon_card_id) on delete cascade, ability_type_id INT references ability_type(ability_type_id), @@ -228,4 +253,3 @@ DROP TABLE staging_furious_fists; -