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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
DROP DATABASE IF EXISTS %MYSQL_LOGIN_DB%;
CREATE DATABASE %MYSQL_LOGIN_DB% CHARACTER SET utf8 DEFAULT COLLATE utf8_hungarian_ci;
GRANT ALL ON %MYSQL_LOGIN_DB%.* TO '%MYSQL_LOGIN_USER%'@'localhost' IDENTIFIED BY '%MYSQL_LOGIN_PW%';
USE %MYSQL_LOGIN_DB%;
--
-- Table structure for table 'login_log'
--
CREATE TABLE `mayorUpdateLog` (
`scriptFile` varchar(255) COLLATE utf8_hungarian_ci NOT NULL DEFAULT '',
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`scriptFile`,`dt`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;
CREATE TABLE loginLog (
logId int(10) unsigned NOT NULL auto_increment,
policy varchar(10) NOT NULL default 'private',
userAccount varchar(50) default NULL,
ip varchar(15) default NULL,
dt datetime default NULL,
flag tinyint(3) unsigned default NULL,
PRIMARY KEY (logId)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_hungarian_ci;
--
-- Table structure for table 'session'
--
CREATE TABLE session (
sessionID char(40) COLLATE utf8_hungarian_ci NOT NULL,
userPassword varchar(32) character set latin1 default NULL,
userAccount varchar(50) default NULL,
userCn varchar(50) default NULL,
studyId BIGINT UNSIGNED NULL,
dt datetime default NULL,
policy varchar(10) COLLATE utf8_hungarian_ci NOT NULL default 'private',
skin varchar(16) default NULL,
lang varchar(5) default NULL,
jsLevel tinyint(3) unsigned default 2,
activity datetime default NULL,
sessionCookie char(40) NOT NULL,
PRIMARY KEY (sessionID,policy)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_hungarian_ci;
--
-- Table structure for table 'settings'
--
CREATE TABLE settings (
userAccount varchar(50) NOT NULL,
policy varchar(10) NOT NULL default 'private',
skin varchar(20) default 'default',
lang varchar(5) default 'hu_HU',
jsLevel tinyint(3) unsigned default 2,
lastlogin datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (userAccount,policy)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_hungarian_ci;
--
-- Table structure for table 'start'
--
CREATE TABLE start (
userAccount varchar(50) NOT NULL,
type varchar(10) NOT NULL default 'column',
name varchar(20) default NULL,
idx tinyint unsigned default 0,
PRIMARY KEY (userAccount,type,name),
KEY (userAccount)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_hungarian_ci;
--
-- Table structure for table 'stat'
--
CREATE TABLE stat (
dt datetime default NULL,
policy varchar(20) default NULL,
page varchar(20) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_hungarian_ci;
CREATE TABLE `cache` (
`sessionID` char(40),
`policy` varchar(10),
`kulcs` varchar(32) NOT NULL,
`ertek` varchar(100), dt DATETIME,
PRIMARY KEY (sessionID,policy,kulcs)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_hungarian_ci;
CREATE TABLE `mayorSsl` (
`sslId` tinyint(1) unsigned NOT NULL AUTO_INCREMENT,
`nodeId` mediumint(8) unsigned zerofill NOT NULL DEFAULT '00000000',
`privateKey` text COLLATE utf8_hungarian_ci NOT NULL,
`publicKey` text COLLATE utf8_hungarian_ci NOT NULL,
`secret` varchar(40) COLLATE utf8_hungarian_ci DEFAULT NULL,
PRIMARY KEY (`sslId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;
CREATE TABLE `mayorKeychain` (
`nodeId` mediumint(8) unsigned zerofill NOT NULL DEFAULT '00000000',
`nodeTipus` enum('intézmény','fenntartó','backup','fejlesztői','controller') COLLATE utf8_hungarian_ci DEFAULT 'intézmény',
`dt` date DEFAULT NULL,
`OMKod` mediumint(8) unsigned zerofill NOT NULL DEFAULT '00000000',
`publicKey` text COLLATE utf8_hungarian_ci NOT NULL,
`valid` tinyint(1) unsigned NOT NULL DEFAULT '1',
`url` varchar(255) COLLATE utf8_hungarian_ci NOT NULL,
`nev` varchar(128) COLLATE utf8_hungarian_ci DEFAULT NULL,
`rovidNev` varchar(16) COLLATE utf8_hungarian_ci DEFAULT NULL,
`cimHelyseg` varchar(32) COLLATE utf8_hungarian_ci DEFAULT NULL,
`cimIrsz` varchar(8) COLLATE utf8_hungarian_ci DEFAULT NULL,
`cimKozteruletNev` varchar(32) COLLATE utf8_hungarian_ci DEFAULT NULL,
`cimKozteruletJelleg` varchar(32) COLLATE utf8_hungarian_ci DEFAULT NULL,
`cimHazszam` varchar(20) COLLATE utf8_hungarian_ci DEFAULT NULL,
`telefon` varchar(64) COLLATE utf8_hungarian_ci DEFAULT NULL,
`fax` varchar(64) COLLATE utf8_hungarian_ci DEFAULT NULL,
`email` varchar(96) COLLATE utf8_hungarian_ci DEFAULT NULL,
`honlap` varchar(96) COLLATE utf8_hungarian_ci DEFAULT NULL,
`kapcsolatNev` varchar(128) COLLATE utf8_hungarian_ci DEFAULT NULL,
`kapcsolatEmail` varchar(96) COLLATE utf8_hungarian_ci DEFAULT NULL,
`kapcsolatTelefon` varchar(64) COLLATE utf8_hungarian_ci DEFAULT NULL,
PRIMARY KEY (`nodeId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;
INSERT IGNORE INTO mayorKeychain (dt,nodeId,nodeTipus,publicKey,url,valid)
VALUES (CURDATE(), '09862967','controller','-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDbMFUWy0Juy/7uHROaLOMPSHMI
Vw/jSmEAKW6lCeIOH2oUVsAQkgsZCFiKqQhH3WbtLrAzSmOA7+rEU3RtgXtPZpHN
2UUPQqoHWoMOkumfIS5oM0sQgSQ738TC0X9yxZlNqZtdpdCa0zjVnGLxqVVhS3KD
+O8uuA7jQwczlSqWJwIDAQAB
-----END PUBLIC KEY-----','https://www.mayor.hu',1);
CREATE TABLE `accountRecovery` (
`recoveryId` int(11) unsigned NOT NULL AUTO_INCREMENT,
`policy` enum('private','parent','public') COLLATE utf8_hungarian_ci NOT NULL,
`userAccount` varchar(32) COLLATE utf8_hungarian_ci NOT NULL,
`selector` char(16) COLLATE utf8_hungarian_ci DEFAULT NULL,
`token` char(64) COLLATE utf8_hungarian_ci DEFAULT NULL,
`expires` datetime DEFAULT NULL,
PRIMARY KEY (`recoveryId`),
KEY `selector` (`selector`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;
CREATE TABLE `facebookConnect` (
`fbUserId` bigint(20) NOT NULL,
`userAccount` varchar(64) COLLATE utf8_hungarian_ci NOT NULL,
`policy` enum('public','parent','private') COLLATE utf8_hungarian_ci DEFAULT NULL,
`fbUserCn` varchar(64) COLLATE utf8_hungarian_ci DEFAULT NULL,
`fbUserEmail` varchar(64) COLLATE utf8_hungarian_ci DEFAULT NULL,
`studyId` varchar(11) COLLATE utf8_hungarian_ci DEFAULT NULL,
UNIQUE KEY `fbUserId` (`fbUserId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;
CREATE TABLE `googleConnect` (
`googleSub` varchar(32) COLLATE utf8_hungarian_ci DEFAULT NULL,
`userAccount` varchar(64) COLLATE utf8_hungarian_ci NOT NULL,
`policy` enum('public','parent','private') COLLATE utf8_hungarian_ci DEFAULT NULL,
`googleUserCn` varchar(64) COLLATE utf8_hungarian_ci DEFAULT NULL,
`googleUserEmail` varchar(64) COLLATE utf8_hungarian_ci DEFAULT NULL,
`studyId` varchar(12) COLLATE utf8_hungarian_ci DEFAULT NULL,
UNIQUE KEY `googleSub` (`googleSub`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;
CREATE TABLE loginLog_a (
logId int(10) unsigned NOT NULL,
policy varchar(10) NOT NULL default 'private',
userAccount varchar(50) default NULL,
ip varchar(15) default NULL,
dt datetime default NULL,
flag tinyint(3) unsigned default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_hungarian_ci;
|