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

Annotation of /YodaProfiler/docs/PAMELAProductionDB.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Fri Oct 20 11:11:09 2006 UTC (18 years, 1 month ago) by mocchiut
Branch: MAIN
Changes since 1.2: +9 -3 lines
GL_RESURS_OFFSET changed, added _RUNID_GEN table, unique run ID number implemented

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     CREATE TABLE `GL_CALO_CALIB` (
182     `ID` int(10) unsigned NOT NULL auto_increment,
183     `ID_ROOT_L0` int(10) unsigned NOT NULL default '0',
184     `EV_ROOT` int(10) unsigned NOT NULL default '0',
185     `FROM_TIME` int(10) unsigned NOT NULL default '0',
186     `TO_TIME` int(10) unsigned NOT NULL default '0',
187     `SECTION` tinyint(3) unsigned NOT NULL default '0',
188     `OBT` int(10) unsigned NOT NULL default '0',
189     `PKT` int(10) unsigned NOT NULL default '0',
190     `BOOT_NUMBER` smallint(5) unsigned NOT NULL default '0',
191     `VALIDATION` tinyint(3) unsigned NOT NULL default '0',
192     PRIMARY KEY (`ID`),
193     KEY `SECTION_index` (`SECTION`),
194     KEY `EV_ROOT_index` (`EV_ROOT`),
195     KEY `ID_ROOT_index` (`ID_ROOT_L0`),
196     KEY `BOOTNUMBER_index` (`BOOT_NUMBER`),
197     KEY `VALID1_index` (`VALIDATION`),
198     CONSTRAINT `CALO_REG_fk` FOREIGN KEY (`ID_ROOT_L0`) REFERENCES `GL_ROOT` (`ID`) ON DELETE CASCADE
199     ) ENGINE=InnoDB;
200    
201     CREATE TABLE `GL_TRK_CALIB` (
202     `ID` int(10) unsigned NOT NULL auto_increment,
203     `ID_ROOT_L0` int(10) unsigned NOT NULL default '0',
204     `EV_ROOT_CALIBTRK1` int(10) unsigned default NULL,
205     `EV_ROOT_CALIBTRK2` int(10) unsigned default NULL,
206     `FROM_TIME` int(10) unsigned NOT NULL default '0',
207     `TO_TIME` int(10) unsigned NOT NULL default '0',
208     `OBT1` int(10) unsigned NOT NULL default '0',
209     `PKT1` int(10) unsigned NOT NULL default '0',
210     `OBT2` int(10) unsigned NOT NULL default '0',
211     `PKT2` int(10) unsigned NOT NULL default '0',
212     `BOOT_NUMBER` smallint(5) unsigned NOT NULL default '0',
213     `VALIDATION` tinyint(3) unsigned NOT NULL default '0',
214     PRIMARY KEY (`ID`),
215     KEY `ID_ROOT_index` (`ID_ROOT_L0`),
216     KEY `EV_ROOT_CALIBTRK1index` (`EV_ROOT_CALIBTRK1`),
217     KEY `EV_ROOT_CALIBTRK2index` (`EV_ROOT_CALIBTRK2`),
218     KEY `BOOTNUMBER_index` (`BOOT_NUMBER`),
219     KEY `VALID2_index` (`VALIDATION`),
220     CONSTRAINT `TRK_REG_fk` FOREIGN KEY (`ID_ROOT_L0`) REFERENCES `GL_ROOT` (`ID`) ON DELETE CASCADE
221     ) ENGINE=InnoDB;
222    
223     CREATE TABLE `GL_S4_CALIB` (
224     `ID` int(10) unsigned NOT NULL auto_increment,
225     `ID_ROOT_L0` int(10) unsigned NOT NULL default '0',
226     `EV_ROOT` int(10) unsigned NOT NULL default '0',
227     `FROM_TIME` int(10) unsigned NOT NULL default '0',
228     `TO_TIME` int(10) unsigned NOT NULL default '0',
229     `OBT` int(10) unsigned NOT NULL default '0',
230     `PKT` int(10) unsigned NOT NULL default '0',
231     `BOOT_NUMBER` smallint(5) unsigned NOT NULL default '0',
232     PRIMARY KEY (`ID`),
233     KEY `ID_ROOT_index` (`ID_ROOT_L0`),
234     KEY `BOOTNUMBER_index` (`BOOT_NUMBER`),
235     CONSTRAINT `S4_REG_fk` FOREIGN KEY (`ID_ROOT_L0`) REFERENCES `GL_ROOT` (`ID`) ON DELETE CASCADE
236     ) ENGINE=InnoDB;
237    
238    

  ViewVC Help
Powered by ViewVC 1.1.23