-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-db.sql
More file actions
40 lines (31 loc) · 1.3 KB
/
create-db.sql
File metadata and controls
40 lines (31 loc) · 1.3 KB
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 database if not exists `bike_finder_api`;
create table `officer` (
`id` int (11) not null auto_increment,
`name` varchar (128) default null,
`is_available` boolean default null,
`last_mission` bigint default null,
primary key(`id`)
) engine=InnoDB auto_increment=1 default charset=utf8;
create table `client` (
`id` int (11) not null auto_increment,
`name` varchar (128) default null,
`nation_code` varchar(45) default null,
`phone_number` varchar(45) default null,
primary key(`id`)
) engine=InnoDB auto_increment=1 default charset=utf8;
create table `case_table`(
`id` int(11) not null auto_increment,
`description` mediumtext default null,
`isAlive` Boolean default null,
`start_date` bigint default null ,
`end_date` bigint default null ,
`client_id` int(11) default null,
`officer_id` int(11) default null,
primary key(`id`),
key `FK_CLIENT_idx` (`client_id`),
constraint `FK_CLIENT` foreign key (`client_id`) references
`client` (`id`) on delete no action on update no action,
key `FK_OFFICER_idx` (`officer_id`),
constraint `FK_OFFICER` foreign key (`officer_id`) references
`officer` (`id`) on delete no action on update no action
)engine=InnoDB auto_increment=1 default charset=utf8;