/[PAMELA software]/YodaProfiler/docs/PAMELAProductionDB.sql
ViewVC logotype

Annotation of /YodaProfiler/docs/PAMELAProductionDB.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (hide annotations) (download)
Mon Dec 18 18:08:03 2006 UTC (17 years, 11 months ago) by mocchiut
Branch: MAIN
Changes since 1.8: +1 -0 lines
New Resurs time zero added

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

  ViewVC Help
Powered by ViewVC 1.1.23