From 5c25e1f6d8fd59eefb3ce2462f1753c29d92445d Mon Sep 17 00:00:00 2001 From: Obeme228 Date: Tue, 29 Sep 2026 09:37:47 +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=20shema?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shema | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/shema b/shema index f98cba0..b0f81cb 100644 --- a/shema +++ b/shema @@ -1,12 +1,15 @@ +drop table if exists card_set; + + create table card_set ( - CARD_SET_NAME VARCHAR(255) not null, - CARD_SET_ID VARCHAR(20) PRIMARY key, - CARD_SET_SERIES VARCHAR(50) not null, - CARD_SET_TOTAL_CARDS inteGER not null, - CARD_SET_data date not null + set_name VARCHAR(255) not null, + set_id VARCHAR(20) PRIMARY key, + set_series VARCHAR(20) not null, + set_total_cards INT not null, + set_release_date date not null ); -insert into card_set (CARD_SET_NAME, CARD_SET_ID, CARD_SET_SERIES, CARD_SET_TOTAL_CARDS, CARD_SET_data) values +insert into card_set (set_name,set_id,set_series,set_total_cards,set_release_date ) values ('XY Базовый набор', 'XY1', 'XY', 146, '2014-02-05'), ('XY Огненная вспышка', 'XY2', 'XY', 106, '2014-05-07'), ('XY Яростный кулак', 'XY3', 'XY', 111, '2014-08-13'), @@ -19,15 +22,14 @@ insert into card_set (CARD_SET_NAME, CARD_SET_ID, CARD_SET_SERIES, CARD_SET_TOTA ('XY Столкновение судеб', 'XY10', 'XY', 124, '2016-05-02'); create table card ( -card_id int primary key, -card_name VARCHAR(50) not null, -card_number VARCHAR(50) not null, -card_set_id int references card_set (card_set_id), -card_name text not null, -card_rarity text not null , -card_type text not null, -card_image_url text not null, -CONSTRAINT unique_set_number unique (card_set_id, card_number) + card_id int primary key, + card_name text not null, + card_number text not null, + card_set_id VARCHAR(20) references card_set(set_id), + card_rarity text not null, + card_type text not null, + card_image_url text not null, + unique (card_set_id, card_number) ); create table pokemon_card (