forked from fmengmii/bayes-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1.sql.new
64 lines (50 loc) · 2.21 KB
/
1.sql.new
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table network_file (
id bigint auto_increment not null,
user_id bigint,
file_name varchar(255),
file_type varchar(255),
file_content LONGTEXT,
is_public tinyint(1) default 0,
update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
constraint uq_network_file_1 unique (file_type,file_name),
constraint pk_network_file primary key (id))
;
create table raw_data_file (
id bigint auto_increment not null,
network_file_id bigint,
file_name varchar(255),
file_type varchar(255),
file_content TEXT,
is_public tinyint(1) default 0,
update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
constraint pk_raw_data_file primary key (id))
;
create table user (
id bigint auto_increment not null,
test varchar(255),
user_name varchar(255),
password varchar(255),
email varchar(255),
first_name varchar(255),
last_name varchar(255),
title varchar(255),
organization varchar(255),
is_approved tinyint(1) default 0,
update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
constraint uq_user_user_name unique (user_name),
constraint uq_user_email unique (email),
constraint pk_user primary key (id))
;
alter table network_file add constraint fk_network_file_user_1 foreign key (user_id) references user (id) on delete restrict on update restrict;
create index ix_network_file_user_1 on network_file (user_id);
alter table raw_data_file add constraint fk_raw_data_file_networkFile_2 foreign key (network_file_id) references network_file (id) on delete restrict on update restrict;
create index ix_raw_data_file_networkFile_2 on raw_data_file (network_file_id);
# --- !Downs
SET FOREIGN_KEY_CHECKS=0;
drop table network_file;
drop table raw_data_file;
drop table user;
SET FOREIGN_KEY_CHECKS=1;