-
Notifications
You must be signed in to change notification settings - Fork 6
/
create_tables.sql
119 lines (105 loc) · 3.39 KB
/
create_tables.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
DROP TABLE IF EXISTS data_type;
create table data_type
(
type_id int NOT NULL unique key auto_increment COMMENT '類型編號',
type_name varchar(50) default '' COMMENT '類型名稱',
type_dir varchar(300) default '' COMMENT '存放路徑',
type_weight double default 1 COMMENT '加權比重'
);
DROP TABLE IF EXISTS image_data;
create table image_data
(
img_id varchar(14) unique key,
type_id int default 1,
img_system_name varchar(50) not null,
img_thumbnail_name varchar(50) not null,
img_file_name varchar(50) not null,
img_upload_time datetime default now(),
img_start_date date not null,
img_end_date date not null,
img_start_time time default '00:00:00',
img_end_time time default '23:59:59',
img_display_count int default 0,
img_display_time int default 5,
img_is_expire bit(1) default 0,
user_id int not null,
img_last_edit_user_id int default 0,
img_is_delete bit(1) default 0,
img_like_count int default 0
);
DROP TABLE IF EXISTS user;
create table user
(
user_id int NOT NULL unique key auto_increment ,
user_name varchar(50) not null,
user_password varchar(360) not null,
user_last_name varchar(50),
user_first_name varchar(50),
user_nickname varchar(50),
user_join_date datetime default now(),
user_email varchar(50),
user_phone_number varchar(20) ,
user_level int default 100,
user_sex int default 0,
user_enable bit(1) default 0,
user_bluetooth_id varchar(50),
user_profession int default 0 not null,
user_birthday datetime
);
DROP TABLE IF EXISTS schedule;
create table schedule
(
sche_sn int not null unique key auto_increment ,
sche_id varchar(14) not null unique key,
sche_target_id varchar(14) not null,
sche_display_time int default 5,
sche_arrange_time datetime default now(),
sche_arrange_mode int not null,
sche_is_used bit(1) default 0,
sche_is_artificial_edit bit(1) default 0
);
DROP TABLE IF EXISTS text_data;
create table text_data
(
text_id varchar(14) unique key,
type_id int default 1,
text_invisible_title varchar(100) not null,
text_system_name varchar(50) not null,
text_upload_time datetime default now(),
text_start_date date not null,
text_end_date date not null,
text_start_time time default '00:00:00',
text_end_time time default '23:59:59',
text_display_count int default 0,
text_display_time int default 5,
text_is_expire bit(1) default 0,
user_id int not null,
text_last_edit_user_id int default 0,
text_is_delete bit(1) default 0,
text_like_count int default 0
);
DROP TABLE IF EXISTS arrange_mode;
create table arrange_mode
(
armd_sn int unique key auto_increment,
armd_mode int default 0,
armd_condition varchar(100),
armd_set_time datetime default now(),
armd_start_time time default '00:00:00',
armd_end_time time default '23:59:59',
armd_is_expire bit(1) default 0,
armd_is_delete bit(1) default 0
);
DROP TABLE IF EXISTS user_prefer;
create table user_prefer
(
pref_id varchar(14) unique key,
user_id int default 0,
pref_data_type_01 varchar(100),
pref_data_type_02 varchar(100),
pref_data_type_03 varchar(100),
pref_data_type_04 varchar(100),
pref_data_type_05 varchar(100),
pref_set_time datetime default now(),
pref_is_delete bit(1) default 0
);