· 6 years ago · Jan 11, 2020, 03:54 AM
1drop table if exists team_request;
2drop table if exists request;
3drop table if exists game_event;
4-- drop table if exists for_check_game_event;
5drop table if exists equipment_item;
6drop table if exists team_member;
7drop table if exists Player;
8drop table if exists sponsor;
9drop table if exists team;
10drop table if exists calendar_item;
11drop table if exists game_ground;
12
13create table game_ground(
14 ground_id serial primary key,
15 address text NOT NULL,
16 capacity integer,
17 ground_name text);
18
19create table calendar_item(
20 calitem_id serial primary key,
21 cdate date NOT NULL );
22
23create table team(
24 team_id serial primary key,
25 teamName varchar(32) NOT NULL,
26 capitan varchar(32),
27 numMember integer,
28 emblem text,
29 teamDescription text);
30
31create table sponsor(
32 sponsor_id serial primary key,
33 login text,
34 ppassword varchar(128),
35 firstName varchar(32),
36 secondName varchar(32),
37 dateOfBirth date,
38 company_name varchar(32),
39 email varchar(32),
40 photo text,
41 information text,
42 registrationDate date);
43
44create table Player(
45 player_id serial primary key,
46 login text,
47 ppassword varchar(128),
48 firstName varchar(32),
49 secondName varchar(32),
50 dateOfBirth date,
51 nickname varchar(32),
52 plocation varchar(32),
53 photo text,
54 email varchar(32),
55 registrationDate date,
56 permission bool DEFAULT FALSE
57 );
58
59create table team_member(
60 team_member_id serial primary key,
61 team_id serial references team(team_id),
62 player_id serial references Player(player_id)
63 );
64
65create table equipment_item(
66 item_id serial primary key,
67 equipmentType varchar(32),
68 equipmentName varchar(32),
69 equipmentPhoto text,
70 player_id serial references Player(player_id)
71 );
72
73create table game_event(
74 game_id serial primary key,
75 gameName varchar(64),
76 gameurl varchar(255),
77 sponsor_id serial references sponsor(sponsor_id),
78 gameTime time without time zone,
79 gameType varchar(32),
80 ground_id serial references game_ground(ground_id),
81 max_player_number integer,
82 game_cost integer,
83 game_information text,
84 calitem_id serial references calendar_item(calitem_id),
85 validate_on boolean
86 );
87
88-- create table for_check_game_event(
89-- game_id serial primary key,
90-- gameName varchar(64),
91-- gameurl varchar(255),
92-- sponsor_id serial references sponsor(sponsor_id),
93-- gameTime time without time zone,
94-- gameType varchar(32),
95-- ground_id serial references game_ground(ground_id),
96-- max_player_number integer,
97-- game_cost integer,
98-- game_information text,
99-- calitem_id serial references calendar_item(calitem_id)
100-- );
101
102create table request(
103 request_id serial primary key,
104 player_id serial references Player(player_id),
105 game_id serial references game_event(game_id)
106);
107
108create table team_request(
109 team_request_id serial primary key,
110 team_id serial references team(team_id),
111 game_id serial references game_event(game_id)
112);
113
114insert into game_ground values(DEFAULT, 'Pylkovo-3', 30, 'Пространство активного отдыха Пулково-3');
115insert into game_ground values(DEFAULT, 'Repino', 80, 'ТАИ');
116insert into game_ground values(DEFAULT, 'СПб', 40, 'Красная жара');
117
118insert into calendar_item values(DEFAULT, '2020-01-9');
119insert into calendar_item values(DEFAULT, '2020-01-15');
120insert into calendar_item values(DEFAULT, '2020-01-31');
121
122insert into team values(DEFAULT,'N.A.M.A.D.', 'Pank', 0, '', 'team NAMAD');
123insert into team values(DEFAULT,'test', 'test', 0, '', 'test');
124
125insert into sponsor values(DEFAULT, 'Persia39', 'pbkdf2:sha256:150000$EHwMsWyV$3ba61713858c425558f724136dc592f28f70eb932075f8e16f88664eac84833c', 'Alexander', 'Antonov', '1998-06-04', 'AAA', 'asd@mail.ru', '', 'Первая компания на планете ААА', '2019-10-10');
126
127insert into Player values(DEFAULT, 'Fynduk', 'pbkdf2:sha256:150000$EHwMsWyV$3ba61713858c425558f724136dc592f28f70eb932075f8e16f88664eac84833c', 'German', 'Duk', '1998-09-15', 'Duker', 'SPB', 'Untitled.png', 'ger-duk@mail.ru', '2018-05-01', True);
128insert into Player values(DEFAULT, 'r144yh', 'pbkdf2:sha256:150000$EHwMsWyV$3ba61713858c425558f724136dc592f28f70eb932075f8e16f88664eac84833c', 'Natali', 'Salova', '1998-11-17', 'Popyg', 'SPB', 'Untitled.png', 'natali144@yandex.ru', '2019-09-15', DEFAULT);
129insert into Player values(DEFAULT, 'test', 'pbkdf2:sha256:150000$EHwMsWyV$3ba61713858c425558f724136dc592f28f70eb932075f8e16f88664eac84833c', 'test', 'test', '1998-11-17', 'test', 'test', 'Untitled.png', 'test@yandex.ru', '2019-09-15', DEFAULT);
130
131insert into team_member values(DEFAULT, 1, 1);
132
133insert into equipment_item values(DEFAULT, 'helmet', 'Шлемак дяди Пети' , '', 1);
134insert into equipment_item values(DEFAULT, 'armor', 'TV-110', '', 1);
135
136insert into game_event values(DEFAULT, 'Cyberpunk', 'http://127.0.0.1:5000/calendar/1', 1, '20:00:00', 'role project', 2, 80, 2500, '', 1, true);
137insert into game_event values(DEFAULT, 'Метро 2033', 'http://127.0.0.1:5000/calendar/2', 1, '08:00:00', 'role project', 3, 40, 3000, 'game about Metro 2033', 2, true);
138insert into game_event values(DEFAULT, 'Пострелушка в Репино','http://127.0.0.1:5000/calendar/3', 1, '12:00:00', 'simple fight', 2, 40, 500, 'ДОРОГИЕ ДРУЗЬЯ!
139Для всех новичков, желающих начать играть в страйкбол! Вы сможете поиграть, с такими же новичками, а не стать пушечным мясом для опытных страйкболистов.
140
141
142
143Приглашаем всех детей на первую игру, где они смогут от души побегать и поиграть в настоящую крутую войнушку!
144
145Ребят ждут несколько очень динамичных миссий, много пиротехники, спецэффектов и интересных игровых персонажей!
146
147А для родителей мы приготовили особые роли в игре, которые приведут в восторг всех детей и доставят удовольствие родителям!
148
149Также, на полигоне будет вкусная еда от наших партнёров по кейтнингу - "Фреш Компани"! Цены очень не большие, а еда очень вкусная и приготовленная с любовью!
150
151И конечно, как всегда на всех наших играх - вкусный чай, сахарок, вода - бесплатно!
152
153Мы ждём в гости и мальчишек и девчонок, а также их родителей!
154Записывайтесь на игру и приезжайте - вам точно понравится!
155
156Будет очень крутая войнушка!', 3, false);
157
158-- insert into for_check_game_event values(DEFAULT, 'Meeting with Natyshonch','http://127.0.0.1:5000/calendar/3', 1, '12:00:00', 'role project', 3, 40, 3000, 'game about Metro 2033', 3);
159
160insert into request values(DEFAULT, 1, 1);
161insert into request values(DEFAULT, 1, 2);
162
163insert into team_request values(DEFAULT, 1, 2);