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

Annotation of /YodaProfiler/docs/PAMELAProductionDB.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Tue Oct 24 14:24:21 2006 UTC (18 years, 1 month ago) by mocchiut
Branch: MAIN
Changes since 1.3: +45 -0 lines
Bug fixed in GL_TIMESYNC

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

  ViewVC Help
Powered by ViewVC 1.1.23