-
Notifications
You must be signed in to change notification settings - Fork 0
/
db_init.sql
40 lines (36 loc) · 1007 Bytes
/
db_init.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
create table booking
(
id bigint not null auto_increment,
date_time datetime(6),
is_open bit not null,
theme_id bigint,
primary key (id)
) engine=InnoDB;
create table region
(
id bigint not null auto_increment,
name varchar(255),
primary key (id)
) engine=InnoDB;
create table store
(
id bigint not null auto_increment,
name varchar(255),
siteuri varchar(255),
region_id bigint,
primary key (id)
) engine=InnoDB;
create table theme
(
id bigint not null auto_increment,
genre integer,
name varchar(255),
store_id bigint,
primary key (id)
) engine=InnoDB;
alter table booking
add constraint FKk359qjvxgjipum19kwobo4vyl foreign key (theme_id) references theme (id);
alter table store
add constraint FKiecbc1b9m21semcf714lasyi5 foreign key (region_id) references region (id);
alter table theme
add constraint FKcrj39cbn6jldet3ekokpnb31 foreign key (store_id) references store (id);