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
----account_mst
DROP TABLE IF EXISTS account_mst;
CREATE TABLE IF NOT EXISTS account_mst(
id int8 unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
login text NOT NULL,
password text NOT NULL,
name varchar(64) NOT NULL,
contact text,
role varchar(128) NOT NULL,
authority_level text NOT NULL,
comment text,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8;
Create INDEX account_mst_name_idx ON account_mst(name);
----grade_mst
DROP TABLE IF EXISTS grade_mst;
CREATE TABLE IF NOT EXISTS grade_mst(
id int8 unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
school_id int8 NOT NULL,
title text NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8;
Create INDEX grade_mst_school_id_idx ON grade_mst(school_id);
----class_mst
DROP TABLE IF EXISTS class_mst;
CREATE TABLE IF NOT EXISTS class_mst(
id int8 unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
school_id int8 NOT NULL,
grade_id int8 NOT NULL,
class_no varchar(64) NOT NULL,
title text NOT NULL,
member_count int8 NOT NULL,
manager_id int8 NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8;
Create INDEX grade_mst_school_id_idx ON class_mst(school_id);
Create INDEX grade_mst_grade_id_idx ON class_mst(grade_id);
Create INDEX grade_mst_class_no_idx ON class_mst(class_no);
----organization_mst
DROP TABLE IF EXISTS organization_mst;
CREATE TABLE IF NOT EXISTS organization_mst(
id int8 unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
submit_date datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
organization_no varchar(255) NOT NULL,
title text NOT NULL,
legal_person varchar(255) NOT NULL,
contact text NOT NULL,
legal_person_imgage1 varchar(255) NOT NULL,
legal_person_imgage2 varchar(255) NOT NULL,
licensen_imgage varchar(255) NOT NULL,
other_imgage varchar(255),
status varchar(255) NOT NULL DEFAULT 'NEW',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8;
Create INDEX grade_mst_id_idx ON organization_mst(id);
Create INDEX grade_mst_submit_date_idx ON organization_mst(submit_date);
Create INDEX grade_mst_status_idx ON organization_mst(status);