1 |
mocchiut |
1.1 |
DROP DATABASE IF EXISTS dbname; |
2 |
|
|
|
3 |
|
|
CREATE DATABASE dbname; |
4 |
|
|
|
5 |
|
|
USE dbname; |
6 |
|
|
|
7 |
|
|
CREATE TABLE `GL_RAW` ( |
8 |
|
|
`ID` int(10) unsigned NOT NULL auto_increment, |
9 |
|
|
`PATH` varchar(255) NOT NULL default '', |
10 |
|
|
`NAME` varchar(255) NOT NULL default '', |
11 |
|
|
`BOOT_NUMBER` smallint(5) unsigned default NULL, |
12 |
|
|
`INSERT_TIME` timestamp NOT NULL default CURRENT_TIMESTAMP, |
13 |
|
|
PRIMARY KEY (`ID`), |
14 |
|
|
KEY `BOOTNUMBER_index` (`BOOT_NUMBER`), |
15 |
|
|
KEY `PATH_index` (`PATH`) |
16 |
|
|
) ENGINE=InnoDB; |
17 |
|
|
|
18 |
|
|
CREATE TABLE `GL_ROOT` ( |
19 |
|
|
`ID` int(10) unsigned NOT NULL auto_increment, |
20 |
|
|
`ID_RAW` int(10) unsigned NOT NULL default '0', |
21 |
|
|
`ID_TIMESYNC` int(10) unsigned NOT NULL default '0', |
22 |
|
|
`PATH` varchar(255) NOT NULL default '', |
23 |
|
|
`NAME` varchar(255) NOT NULL default '', |
24 |
|
|
`INSERT_TIME` timestamp NOT NULL default CURRENT_TIMESTAMP, |
25 |
|
|
PRIMARY KEY (`ID`), |
26 |
|
|
KEY `ID_RAW_index` (`ID_RAW`), |
27 |
|
|
KEY `PATH_index` (`PATH`), |
28 |
|
|
CONSTRAINT `ROOT_fk` FOREIGN KEY (`ID_RAW`) REFERENCES `GL_RAW` (`ID`) ON DELETE CASCADE |
29 |
|
|
) ENGINE=InnoDB; |
30 |
|
|
|
31 |
|
|
CREATE TABLE `GL_RESURS_OFFSET` ( |
32 |
|
|
`ID` int(10) unsigned NOT NULL auto_increment, |
33 |
|
|
`FROM_ID_RAW` int(10) unsigned NOT NULL default '0', |
34 |
|
|
`TO_ID_RAW` int(10) unsigned NOT NULL default '0', |
35 |
|
|
`OFFSET_DATE` timestamp default '0000-00-00 00:00:00', |
36 |
|
|
`INSERT_TIME` timestamp NOT NULL default CURRENT_TIMESTAMP, |
37 |
|
|
PRIMARY KEY (`ID`) |
38 |
|
|
) ENGINE=InnoDB; |
39 |
|
|
|
40 |
|
|
INSERT INTO GL_RESURS_OFFSET VALUES(0,'1','4294967295','2006-06-14 21:00:00',NULL); |
41 |
|
|
|
42 |
|
|
CREATE TABLE `GL_TIMESYNC` ( |
43 |
|
|
`ID` int(10) unsigned NOT NULL auto_increment, |
44 |
|
|
`ID_RAW` int(10) unsigned NOT NULL default '0', |
45 |
|
|
`OBT0` int(10) unsigned NOT NULL default '0', |
46 |
|
|
`TIMESYNC` int(10) unsigned NOT NULL default '0', |
47 |
|
|
`TYPE` smallint(5) unsigned NOT NULL default '0', |
48 |
|
|
PRIMARY KEY (`ID`), |
49 |
|
|
KEY `ID_RAW_index` (`ID_RAW`), |
50 |
|
|
KEY `TYPE_index` (`TYPE`), |
51 |
|
|
CONSTRAINT `TIME_RAW_fk` FOREIGN KEY (`ID_RAW`) REFERENCES `GL_RAW` (`ID`) ON DELETE CASCADE |
52 |
|
|
) ENGINE=InnoDB; |
53 |
|
|
|
54 |
|
|
CREATE TABLE `GL_PARAM` ( |
55 |
|
|
`ID` int(10) unsigned NOT NULL auto_increment, |
56 |
|
|
`PATH` varchar(255) NOT NULL default '', |
57 |
|
|
`NAME` varchar(255) NOT NULL default '', |
58 |
|
|
`FROM_TIME` int(10) unsigned NOT NULL default '0', |
59 |
|
|
`TO_TIME` int(10) unsigned NOT NULL default '0', |
60 |
mocchiut |
1.2 |
`TYPE` smallint(5) unsigned NOT NULL default '0', |
61 |
mocchiut |
1.1 |
`DESCR` varchar(255) NOT NULL default '', |
62 |
|
|
`INSERT_TIME` timestamp NOT NULL default CURRENT_TIMESTAMP, |
63 |
|
|
PRIMARY KEY (`ID`), |
64 |
|
|
KEY `PATH_index` (`PATH`), |
65 |
|
|
KEY `NAME_index` (`NAME`), |
66 |
|
|
KEY `TYPE_index` (`TYPE`), |
67 |
|
|
KEY `DESCR_index` (`DESCR`) |
68 |
|
|
) ENGINE=InnoDB; |
69 |
|
|
|
70 |
|
|
CREATE TABLE `GL_TLE` ( |
71 |
|
|
`ID` int(10) NOT NULL auto_increment, |
72 |
|
|
`TLE1` varchar(255) NOT NULL default '', |
73 |
|
|
`TLE2` varchar(255) NOT NULL default '', |
74 |
|
|
`TLE3` varchar(255) NOT NULL default '', |
75 |
mocchiut |
1.2 |
`FROM_TIME` datetime NOT NULL default '0000-00-00 00:00:00', |
76 |
mocchiut |
1.1 |
`INSERT_TIME` timestamp NOT NULL default CURRENT_TIMESTAMP, |
77 |
|
|
PRIMARY KEY (`ID`) |
78 |
|
|
) ENGINE=InnoDB; |
79 |
|
|
|
80 |
|
|
CREATE TABLE `GL_RUN` ( |
81 |
|
|
`ID` int(10) unsigned NOT NULL auto_increment, |
82 |
|
|
`ID_RUN_FRAG` int(10) unsigned NOT NULL default '0', |
83 |
|
|
`ID_ROOT_L0` int(10) unsigned NOT NULL default '0', |
84 |
|
|
`ID_ROOT_L2` int(10) unsigned NOT NULL default '0', |
85 |
|
|
`RUNHEADER_TIME` int(10) unsigned NOT NULL default '0', |
86 |
|
|
`RUNTRAILER_TIME` int(10) unsigned NOT NULL default '0', |
87 |
|
|
`RUNHEADER_OBT` int(10) unsigned NOT NULL default '0', |
88 |
|
|
`RUNTRAILER_OBT` int(10) unsigned NOT NULL default '0', |
89 |
|
|
`RUNHEADER_PKT` int(10) unsigned NOT NULL default '0', |
90 |
|
|
`RUNTRAILER_PKT` int(10) unsigned NOT NULL default '0', |
91 |
|
|
`BOOT_NUMBER` smallint(5) unsigned NOT NULL default '0', |
92 |
|
|
`EV_FROM` int(10) unsigned NOT NULL default '0', |
93 |
|
|
`EV_TO` int(10) unsigned NOT NULL default '0', |
94 |
|
|
`NEVENTS` int(10) unsigned NOT NULL default '0', |
95 |
|
|
`PKT_COUNTER` int(10) unsigned NOT NULL default '0', |
96 |
|
|
`PKT_READY_COUNTER` int(10) unsigned NOT NULL default '0', |
97 |
|
|
`COMPILATIONTIMESTAMP` int(10) unsigned NOT NULL default '0', |
98 |
|
|
`FAV_WRK_SCHEDULE` tinyint(3) unsigned NOT NULL default '0', |
99 |
|
|
`EFF_WRK_SCHEDULE` tinyint(3) unsigned NOT NULL default '0', |
100 |
|
|
`PRH_VAR_TRG_MODE_A` int(10) unsigned NOT NULL default '0', |
101 |
|
|
`PRH_VAR_TRG_MODE_B` int(10) unsigned NOT NULL default '0', |
102 |
|
|
`ACQ_BUILD_INFO` int(10) unsigned NOT NULL default '0', |
103 |
|
|
`ACQ_VAR_INFO` smallint(5) unsigned NOT NULL default '0', |
104 |
|
|
`RM_ACQ_AFTER_CALIB` tinyint(3) NOT NULL default '0', |
105 |
|
|
`RM_ACQ_SETTING_MODE` tinyint(3) NOT NULL default '0', |
106 |
|
|
`TRK_CALIB_USED` int(10) unsigned NOT NULL default '0', |
107 |
|
|
`CAL_DSP_MASK` tinyint(3) unsigned NOT NULL default '0', |
108 |
|
|
`LAST_TIMESYNC` int(10) unsigned NOT NULL default '0', |
109 |
|
|
`OBT_TIMESYNC` int(10) unsigned NOT NULL default '0', |
110 |
|
|
`VALIDATION` tinyint(3) unsigned NOT NULL default '0', |
111 |
|
|
`INSERT_TIME` timestamp NOT NULL default CURRENT_TIMESTAMP, |
112 |
|
|
PRIMARY KEY (`ID`), |
113 |
|
|
KEY `ID_RUN_FRAG_index` (`ID_RUN_FRAG`), |
114 |
|
|
KEY `ID_ROOT_L0_index` (`ID_ROOT_L0`), |
115 |
|
|
KEY `ID_ROOT_L2_index` (`ID_ROOT_L2`), |
116 |
|
|
KEY `COMPILATIONTS_index` (`COMPILATIONTIMESTAMP`), |
117 |
|
|
KEY `VALID_index` (`VALIDATION`), |
118 |
|
|
KEY `TRKCALIB_index` (`TRK_CALIB_USED`), |
119 |
|
|
KEY `CALDSPMASK_index` (`CAL_DSP_MASK`), |
120 |
|
|
KEY `EFF_WS_index` (`EFF_WRK_SCHEDULE`), |
121 |
|
|
KEY `FAV_WS_index` (`FAV_WRK_SCHEDULE`), |
122 |
|
|
KEY `RM_ACQ_AFTER_CALIB_index` (`RM_ACQ_AFTER_CALIB`), |
123 |
|
|
KEY `RM_ACQ_SETTING_MODE_index` (`RM_ACQ_SETTING_MODE`), |
124 |
|
|
KEY `ACQ_VAR_INFO_index` (`ACQ_VAR_INFO`), |
125 |
|
|
KEY `TRG_MODE_A_index` (`PRH_VAR_TRG_MODE_A`), |
126 |
|
|
KEY `TRG_MODE_B_index` (`PRH_VAR_TRG_MODE_B`), |
127 |
|
|
KEY `NEVENTS_index` (`NEVENTS`), |
128 |
|
|
KEY `BOOTNUMBER_index` (`BOOT_NUMBER`), |
129 |
|
|
KEY `ID_RUN_fk_constraint` (`ID_ROOT_L0`), |
130 |
|
|
KEY `ID_RUN_L2_fk_constraint` (`ID_ROOT_L2`), |
131 |
|
|
CONSTRAINT `ID_RUN_fk_constraint` FOREIGN KEY (`ID_ROOT_L0`) REFERENCES `GL_ROOT` (`ID`) ON DELETE CASCADE |
132 |
|
|
) ENGINE=InnoDB; |
133 |
|
|
|
134 |
|
|
CREATE TABLE `GL_RUN_FRAGMENTS` ( |
135 |
|
|
`ID` int(10) unsigned NOT NULL auto_increment, |
136 |
|
|
`ID_RUN_FRAG` int(10) unsigned NOT NULL default '0', |
137 |
|
|
`ID_ROOT_L0` int(10) unsigned NOT NULL default '0', |
138 |
|
|
`ID_ROOT_L2` int(10) unsigned NOT NULL default '0', |
139 |
|
|
`RUNHEADER_TIME` int(10) unsigned NOT NULL default '0', |
140 |
|
|
`RUNTRAILER_TIME` int(10) unsigned NOT NULL default '0', |
141 |
|
|
`RUNHEADER_OBT` int(10) unsigned NOT NULL default '0', |
142 |
|
|
`RUNTRAILER_OBT` int(10) unsigned NOT NULL default '0', |
143 |
|
|
`RUNHEADER_PKT` int(10) unsigned NOT NULL default '0', |
144 |
|
|
`RUNTRAILER_PKT` int(10) unsigned NOT NULL default '0', |
145 |
|
|
`BOOT_NUMBER` smallint(5) unsigned NOT NULL default '0', |
146 |
|
|
`EV_FROM` int(10) unsigned NOT NULL default '0', |
147 |
|
|
`EV_TO` int(10) unsigned NOT NULL default '0', |
148 |
|
|
`NEVENTS` int(10) unsigned NOT NULL default '0', |
149 |
|
|
`PKT_COUNTER` int(10) unsigned NOT NULL default '0', |
150 |
|
|
`PKT_READY_COUNTER` int(10) unsigned NOT NULL default '0', |
151 |
|
|
`COMPILATIONTIMESTAMP` int(10) unsigned NOT NULL default '0', |
152 |
|
|
`FAV_WRK_SCHEDULE` tinyint(3) unsigned NOT NULL default '0', |
153 |
|
|
`EFF_WRK_SCHEDULE` tinyint(3) unsigned NOT NULL default '0', |
154 |
|
|
`PRH_VAR_TRG_MODE_A` int(10) unsigned NOT NULL default '0', |
155 |
|
|
`PRH_VAR_TRG_MODE_B` int(10) unsigned NOT NULL default '0', |
156 |
|
|
`ACQ_BUILD_INFO` int(10) unsigned NOT NULL default '0', |
157 |
|
|
`ACQ_VAR_INFO` smallint(5) unsigned NOT NULL default '0', |
158 |
|
|
`RM_ACQ_AFTER_CALIB` tinyint(3) NOT NULL default '0', |
159 |
|
|
`RM_ACQ_SETTING_MODE` tinyint(3) NOT NULL default '0', |
160 |
|
|
`TRK_CALIB_USED` int(10) unsigned NOT NULL default '0', |
161 |
|
|
`CAL_DSP_MASK` tinyint(3) unsigned NOT NULL default '0', |
162 |
|
|
`LAST_TIMESYNC` int(10) unsigned NOT NULL default '0', |
163 |
|
|
`OBT_TIMESYNC` int(10) unsigned NOT NULL default '0', |
164 |
|
|
`VALIDATION` tinyint(3) unsigned NOT NULL default '0', |
165 |
|
|
`INSERT_TIME` timestamp NOT NULL default CURRENT_TIMESTAMP, |
166 |
|
|
PRIMARY KEY (`ID`), |
167 |
|
|
KEY `ID_RUN_FRAG_index` (`ID_RUN_FRAG`), |
168 |
|
|
KEY `ID_ROOT_L0_index` (`ID_ROOT_L0`), |
169 |
|
|
KEY `BOOTNUMBER_index` (`BOOT_NUMBER`), |
170 |
|
|
KEY `TRKCALIB_index` (`TRK_CALIB_USED`), |
171 |
|
|
KEY `NID_RUN_fk_constraint` (`ID_ROOT_L0`), |
172 |
|
|
CONSTRAINT `NID_RUN_fk_constraint` FOREIGN KEY (`ID_ROOT_L0`) REFERENCES `GL_ROOT` (`ID`) ON DELETE CASCADE |
173 |
|
|
) ENGINE=InnoDB; |
174 |
|
|
|
175 |
|
|
CREATE TABLE `GL_CALO_CALIB` ( |
176 |
|
|
`ID` int(10) unsigned NOT NULL auto_increment, |
177 |
|
|
`ID_ROOT_L0` int(10) unsigned NOT NULL default '0', |
178 |
|
|
`EV_ROOT` int(10) unsigned NOT NULL default '0', |
179 |
|
|
`FROM_TIME` int(10) unsigned NOT NULL default '0', |
180 |
|
|
`TO_TIME` int(10) unsigned NOT NULL default '0', |
181 |
|
|
`SECTION` tinyint(3) unsigned NOT NULL default '0', |
182 |
|
|
`OBT` int(10) unsigned NOT NULL default '0', |
183 |
|
|
`PKT` int(10) unsigned NOT NULL default '0', |
184 |
|
|
`BOOT_NUMBER` smallint(5) unsigned NOT NULL default '0', |
185 |
|
|
`VALIDATION` tinyint(3) unsigned NOT NULL default '0', |
186 |
|
|
PRIMARY KEY (`ID`), |
187 |
|
|
KEY `SECTION_index` (`SECTION`), |
188 |
|
|
KEY `EV_ROOT_index` (`EV_ROOT`), |
189 |
|
|
KEY `ID_ROOT_index` (`ID_ROOT_L0`), |
190 |
|
|
KEY `BOOTNUMBER_index` (`BOOT_NUMBER`), |
191 |
|
|
KEY `VALID1_index` (`VALIDATION`), |
192 |
|
|
CONSTRAINT `CALO_REG_fk` FOREIGN KEY (`ID_ROOT_L0`) REFERENCES `GL_ROOT` (`ID`) ON DELETE CASCADE |
193 |
|
|
) ENGINE=InnoDB; |
194 |
|
|
|
195 |
|
|
CREATE TABLE `GL_TRK_CALIB` ( |
196 |
|
|
`ID` int(10) unsigned NOT NULL auto_increment, |
197 |
|
|
`ID_ROOT_L0` int(10) unsigned NOT NULL default '0', |
198 |
|
|
`EV_ROOT_CALIBTRK1` int(10) unsigned default NULL, |
199 |
|
|
`EV_ROOT_CALIBTRK2` int(10) unsigned default NULL, |
200 |
|
|
`FROM_TIME` int(10) unsigned NOT NULL default '0', |
201 |
|
|
`TO_TIME` int(10) unsigned NOT NULL default '0', |
202 |
|
|
`OBT1` int(10) unsigned NOT NULL default '0', |
203 |
|
|
`PKT1` int(10) unsigned NOT NULL default '0', |
204 |
|
|
`OBT2` int(10) unsigned NOT NULL default '0', |
205 |
|
|
`PKT2` int(10) unsigned NOT NULL default '0', |
206 |
|
|
`BOOT_NUMBER` smallint(5) unsigned NOT NULL default '0', |
207 |
|
|
`VALIDATION` tinyint(3) unsigned NOT NULL default '0', |
208 |
|
|
PRIMARY KEY (`ID`), |
209 |
|
|
KEY `ID_ROOT_index` (`ID_ROOT_L0`), |
210 |
|
|
KEY `EV_ROOT_CALIBTRK1index` (`EV_ROOT_CALIBTRK1`), |
211 |
|
|
KEY `EV_ROOT_CALIBTRK2index` (`EV_ROOT_CALIBTRK2`), |
212 |
|
|
KEY `BOOTNUMBER_index` (`BOOT_NUMBER`), |
213 |
|
|
KEY `VALID2_index` (`VALIDATION`), |
214 |
|
|
CONSTRAINT `TRK_REG_fk` FOREIGN KEY (`ID_ROOT_L0`) REFERENCES `GL_ROOT` (`ID`) ON DELETE CASCADE |
215 |
|
|
) ENGINE=InnoDB; |
216 |
|
|
|
217 |
|
|
CREATE TABLE `GL_S4_CALIB` ( |
218 |
|
|
`ID` int(10) unsigned NOT NULL auto_increment, |
219 |
|
|
`ID_ROOT_L0` int(10) unsigned NOT NULL default '0', |
220 |
|
|
`EV_ROOT` int(10) unsigned NOT NULL default '0', |
221 |
|
|
`FROM_TIME` int(10) unsigned NOT NULL default '0', |
222 |
|
|
`TO_TIME` int(10) unsigned NOT NULL default '0', |
223 |
|
|
`OBT` int(10) unsigned NOT NULL default '0', |
224 |
|
|
`PKT` int(10) unsigned NOT NULL default '0', |
225 |
|
|
`BOOT_NUMBER` smallint(5) unsigned NOT NULL default '0', |
226 |
|
|
PRIMARY KEY (`ID`), |
227 |
|
|
KEY `ID_ROOT_index` (`ID_ROOT_L0`), |
228 |
|
|
KEY `BOOTNUMBER_index` (`BOOT_NUMBER`), |
229 |
|
|
CONSTRAINT `S4_REG_fk` FOREIGN KEY (`ID_ROOT_L0`) REFERENCES `GL_ROOT` (`ID`) ON DELETE CASCADE |
230 |
|
|
) ENGINE=InnoDB; |
231 |
|
|
|
232 |
|
|
|