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

Annotation of /YodaProfiler/docs/PAMELAProductionDB.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download)
Thu Nov 9 16:47:46 2006 UTC (18 years ago) by mocchiut
Branch: MAIN
CVS Tags: v2r04, v2r03
Changes since 1.5: +2 -0 lines
Time screw bug in install_DB.sh fixed + get rid completely of TDatime

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

  ViewVC Help
Powered by ViewVC 1.1.23