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

Annotation of /YodaProfiler/docs/PAMELAProductionDB.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (hide annotations) (download)
Thu Jan 11 14:01:22 2007 UTC (17 years, 10 months ago) by mocchiut
Branch: MAIN
CVS Tags: v3r00
Changes since 1.9: +1 -0 lines
Added new Resurs time zero

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

  ViewVC Help
Powered by ViewVC 1.1.23