db.sql 23.1 KB
Newer Older
Wei Shoulin's avatar
Wei Shoulin committed
1
2
/*----------------facility------------------------------*/
drop table if exists t_module_status;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
3

Wei Shoulin's avatar
Wei Shoulin committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
drop table if exists t_observation;

drop table if exists t_detector;

drop table if exists t_detector_status;

drop table if exists t_facility_status;

drop table if exists t_guiding;

/*----------------msc------------------------------*/
drop table if exists msc_level0_data;

drop table if exists msc_level0_header;

drop table if exists msc_level0_prc;

drop table if exists msc_cal2level0;

drop table if exists msc_cal_header;

drop table if exists msc_cal_merge;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
26
27
28
29
30

drop table if exists msc_level1_data;

drop table if exists msc_level1_header;

Wei Shoulin's avatar
Wei Shoulin committed
31
drop table if exists msc_level1_prc;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
32

Wei Shoulin's avatar
Wei Shoulin committed
33
drop table if exists msc_level1_ref;
Wei Shoulin's avatar
ifs ver    
Wei Shoulin committed
34
35
36
37
38
39

drop table if exists msc_level2_data;

drop table if exists msc_level2_header;

drop table if exists msc_level2_catalog;
Wei Shoulin's avatar
Wei Shoulin committed
40
/*----------------ifs------------------------------*/
Wei Shoulin's avatar
c3    
Wei Shoulin committed
41

Wei Shoulin's avatar
Wei Shoulin committed
42
drop table if exists ifs_level0_data;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
43

Wei Shoulin's avatar
Wei Shoulin committed
44
drop table if exists ifs_level0_header;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
45

Wei Shoulin's avatar
Wei Shoulin committed
46
drop table if exists ifs_level0_prc;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
47

Wei Shoulin's avatar
Wei Shoulin committed
48
drop table if exists ifs_cal2level0;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
49

Wei Shoulin's avatar
Wei Shoulin committed
50
drop table if exists ifs_cal_header;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
51

Wei Shoulin's avatar
Wei Shoulin committed
52
drop table if exists ifs_cal_merge;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
53

Wei Shoulin's avatar
Wei Shoulin committed
54
drop table if exists ifs_level1_data;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
55

Wei Shoulin's avatar
Wei Shoulin committed
56
drop table if exists ifs_level1_header;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
57

Wei Shoulin's avatar
Wei Shoulin committed
58
drop table if exists ifs_level1_prc;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
59

Wei Shoulin's avatar
Wei Shoulin committed
60
drop table if exists ifs_level1_ref;
Wei Shoulin's avatar
mci 0-1    
Wei Shoulin committed
61
/*----------------mci------------------------------*/
Wei Shoulin's avatar
Wei Shoulin committed
62

Wei Shoulin's avatar
mci 0-1    
Wei Shoulin committed
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
drop table if exists mci_level0_data;

drop table if exists mci_level0_header;

drop table if exists mci_level0_prc;

drop table if exists mci_cal2level0;

drop table if exists mci_cal_header;

drop table if exists mci_cal_merge;

drop table if exists mci_level1_data;

drop table if exists mci_level1_header;

drop table if exists mci_level1_prc;

drop table if exists mci_level1_ref;
Wei Shoulin's avatar
Wei Shoulin committed
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*----------------sls------------------------------*/
drop table if exists sls_level0_data;

drop table if exists sls_level0_header;

drop table if exists sls_level0_prc;

drop table if exists sls_cal2level0;

drop table if exists sls_cal_header;

drop table if exists sls_cal_merge;

drop table if exists sls_level1_data;

drop table if exists sls_level1_header;

drop table if exists sls_level1_prc;

drop table if exists sls_level1_ref;

drop table if exists sls_level2_spectra;

/*===========================facility===================================*/
create table t_detector
(
   no                   varchar(10) not null,
   detector_name        varchar(256) not null,
   module_id            varchar(20),
   filter_id            varchar(20),
   create_time          datetime,
   update_time          datetime,
   primary key (no)
);
Wei Shoulin's avatar
Wei Shoulin committed
116
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
117
/* Table: t_detector_status                                     */
Wei Shoulin's avatar
Wei Shoulin committed
118
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
119
create table t_detector_status
Wei Shoulin's avatar
Wei Shoulin committed
120
121
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
122
123
124
125
   detector_no          varchar(10) not null,
   status               varchar(256) not null,
   status_time          datetime,
   create_time          datetime
Wei Shoulin's avatar
Wei Shoulin committed
126
);
Wei Shoulin's avatar
Wei Shoulin committed
127

Wei Shoulin's avatar
Wei Shoulin committed
128
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
129
/* Table: t_facility_status                                     */
Wei Shoulin's avatar
Wei Shoulin committed
130
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
131
132
133
134
135
136
create table t_facility_status
(
   id                   integer PRIMARY KEY autoincrement,
   status               varchar(256) not null,
   status_time          datetime,
   create_time          datetime
Wei Shoulin's avatar
Wei Shoulin committed
137
);
Wei Shoulin's avatar
Wei Shoulin committed
138

Wei Shoulin's avatar
Wei Shoulin committed
139
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
140
/* Table: t_guiding                                             */
Wei Shoulin's avatar
Wei Shoulin committed
141
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
142
create table t_guiding
Wei Shoulin's avatar
Wei Shoulin committed
143
(
Wei Shoulin's avatar
Wei Shoulin committed
144
145
146
147
148
   id                   integer PRIMARY KEY autoincrement,
   filename             varbinary(128),
   guiding_file_path    varchar(256) not null,
   guiding_no           varchar(256),
   create_time          datetime
Wei Shoulin's avatar
Wei Shoulin committed
149
150
);
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
151
/* Table: t_module_status                                       */
Wei Shoulin's avatar
Wei Shoulin committed
152
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
153
create table t_module_status
Wei Shoulin's avatar
Wei Shoulin committed
154
155
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
   module_id            varbinary(20),
   status               varchar(256) not null,
   status_time          datetime,
   create_time          datetime
);

/*==============================================================*/
/* Table: t_observation                                         */
/*==============================================================*/
create table t_observation
(
   id                   integer PRIMARY KEY autoincrement,
   obs_id               varchar(10),
   obs_time             datetime,
   exp_time             float,
   module_id            varchar(20),
   obs_type             varchar(16),
   facility_status_id   int(20),
   module_status_id     int(20),
   qc0_status           tinyint(1),
   qc0_time             datetime,
Wei Shoulin's avatar
Wei Shoulin committed
177
178
179
   prc_status           tinyint(1),
   prc_time             datetime,
   create_time          datetime,
Wei Shoulin's avatar
Wei Shoulin committed
180
   import_status        tinyint(1)
Wei Shoulin's avatar
Wei Shoulin committed
181
);
Wei Shoulin's avatar
Wei Shoulin committed
182
183
184

/*===========================msc===================================*/
create table msc_level0_data
Wei Shoulin's avatar
c3    
Wei Shoulin committed
185
186
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
187
   level0_id            varchar(20) not null,
Wei Shoulin's avatar
Wei Shoulin committed
188
189
190
191
192
193
   obs_id               varchar(10) not null,
   detector_no          varchar(10) not null,
   obs_type             varchar(16),
   obs_time             datetime,
   exp_time             float,
   detector_status_id   int(20),
Wei Shoulin's avatar
c3    
Wei Shoulin committed
194
195
   filename             varchar(128),
   file_path            varchar(256),
Wei Shoulin's avatar
Wei Shoulin committed
196
197
   qc0_status           tinyint(1),
   qc0_time             datetime,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
198
199
   prc_status           tinyint(1),
   prc_time             datetime,
Wei Shoulin's avatar
Wei Shoulin committed
200
   create_time          datetime
Wei Shoulin's avatar
Wei Shoulin committed
201
);
Wei Shoulin's avatar
Wei Shoulin committed
202
203

create table msc_level0_header
Wei Shoulin's avatar
c3    
Wei Shoulin committed
204
205
206
207
208
209
210
211
(
   id                   int(20) not null,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);

Wei Shoulin's avatar
Wei Shoulin committed
212
213
214
215
216
217
218
219
220
221
222
create table msc_level0_prc
(
   id                   integer PRIMARY KEY autoincrement,
   level0_id            varchar(20) not null,
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
   params_file_path     varchar(256),
   prc_status           int(2),
   prc_time             datetime,
   result_file_path            varchar(256)
);
Wei Shoulin's avatar
c3    
Wei Shoulin committed
223
224
225
create table msc_level1_data
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
226
   level0_id            varchar(20) not null,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
227
228
229
230
231
232
233
234
235
236
237
   data_type            varchar(64) not null,
   cor_sci_id           int(20),
   prc_params           varchar(1024),
   filename             varchar(128),
   file_path            varchar(256),
   prc_status           tinyint(1),
   prc_time             datetime,
   qc1_status           tinyint(1),
   qc1_time             datetime,
   create_time          datetime,
   pipeline_id          varchar(60)
Wei Shoulin's avatar
Wei Shoulin committed
238
);
Wei Shoulin's avatar
Wei Shoulin committed
239
240
241
242
243
244
create table msc_level1_ref (
  level1_id int(20) not null,
  ref_type varchar(64) not null,
  cal_id int(20) not null,
  primary key (level1_id, ref_type)
);
Wei Shoulin's avatar
c3    
Wei Shoulin committed
245
246
247
248
249
250
251
create table msc_level1_header
(
   id                   int(20) not null,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
Wei Shoulin's avatar
Wei Shoulin committed
252
);
Wei Shoulin's avatar
Wei Shoulin committed
253
create table msc_cal2level0
Wei Shoulin's avatar
c3    
Wei Shoulin committed
254
255
(
   merge_id             int(20) not null,
Wei Shoulin's avatar
Wei Shoulin committed
256
   level0_id            varchar(20) not null,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
257
   primary key (merge_id, level0_id)
Wei Shoulin's avatar
Wei Shoulin committed
258
259
);

Wei Shoulin's avatar
Wei Shoulin committed
260
create table msc_cal_header
Wei Shoulin's avatar
c3    
Wei Shoulin committed
261
262
263
264
265
266
(
   id                   int(20) not null,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
Wei Shoulin's avatar
Wei Shoulin committed
267
268
);

Wei Shoulin's avatar
Wei Shoulin committed
269
create table msc_cal_merge
Wei Shoulin's avatar
c3    
Wei Shoulin committed
270
271
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
272
273
   cal_id               varchar(20) not null,
   detector_no          varchar(10) not null,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
274
275
276
277
278
279
280
281
282
283
   ref_type             varchar(16),
   obs_time             datetime,
   exp_time             float,
   filename             varchar(128),
   file_path            varchar(256),
   qc1_status           tinyint(1),
   qc1_time             datetime,
   prc_status           tinyint(1),
   prc_time             datetime,
   create_time          datetime
Wei Shoulin's avatar
Wei Shoulin committed
284
);
Wei Shoulin's avatar
Wei Shoulin committed
285
286
287
288
289
290
291
292
293
294
295
create table msc_level1_prc
(
   id                   integer PRIMARY KEY autoincrement,
   level1_id            int(20) not null,
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
   params_file_path     varchar(256),
   prc_status           int(2),
   prc_time             datetime,
   result_file_path            varchar(256)
);
Wei Shoulin's avatar
ifs ver    
Wei Shoulin committed
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315

create table msc_level2_data (
   id integer PRIMARY KEY autoincrement,
   level1_id            int(20)          not null,
   data_type            VARCHAR(64)          not null,
   filename             VARCHAR(128)         null,
   file_path            VARCHAR(256)         null,
   prc_status           tinyint(1),
   prc_time             datetime                 null,
   qc2_status           tinyint(1),
   qc2_time             datetime                 null,
   create_time          datetime                 null
);

create table msc_level2_header (
   id                   BIGINT                 not null,
   ra                   float8               null,
   "dec"                float8               null,
   constraint PK_MSC_LEVEL2_HEADER primary key (id)
);
Wei Shoulin's avatar
Wei Shoulin committed
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
/*===========================ifs===================================*/
create table ifs_level0_data
(
   id                   integer PRIMARY KEY autoincrement,
   level0_id            varchar(20) not null,
   obs_id               varchar(10) not null,
   detector_no          varchar(10) not null,
   obs_type             varchar(16),
   obs_time             datetime,
   exp_time             float,
   detector_status_id   int(20),
   filename             varchar(128),
   file_path            varchar(256),
   qc0_status           tinyint(1),
   qc0_time             datetime,
   prc_status           tinyint(1),
   prc_time             datetime,
   create_time          datetime
);
Wei Shoulin's avatar
Wei Shoulin committed
335

Wei Shoulin's avatar
Wei Shoulin committed
336
create table ifs_level0_header
Wei Shoulin's avatar
c3    
Wei Shoulin committed
337
(
Wei Shoulin's avatar
Wei Shoulin committed
338
339
340
   id                   int(20) not null,
   ra                   float,
   "dec"                float,
Wei Shoulin's avatar
ifs ver    
Wei Shoulin committed
341
342
   object_name          varchar(64) not null,
   version              varchar(64) not null,
Wei Shoulin's avatar
Wei Shoulin committed
343
   primary key (id)
Wei Shoulin's avatar
Wei Shoulin committed
344
);
Wei Shoulin's avatar
c3    
Wei Shoulin committed
345

Wei Shoulin's avatar
Wei Shoulin committed
346
create table ifs_level0_prc
Wei Shoulin's avatar
c3    
Wei Shoulin committed
347
348
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
349
350
351
352
353
354
355
356
357
358
359
360
361
   level0_id            varchar(20) not null,
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
   params_file_path     varchar(256),
   prc_status           int(2),
   prc_time             datetime,
   result_file_path            varchar(256)
);
create table ifs_cal2level0
(
   merge_id             int(20) not null,
   level0_id            varchar(20) not null,
   primary key (merge_id, level0_id)
Wei Shoulin's avatar
c3    
Wei Shoulin committed
362
363
);

Wei Shoulin's avatar
Wei Shoulin committed
364
365
366
367
368
369
370
371
372
373
create table ifs_cal_header
(
   id                   int(20) not null,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);

create table ifs_cal_merge
Wei Shoulin's avatar
c3    
Wei Shoulin committed
374
375
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
376
377
378
379
380
381
382
383
384
385
386
   cal_id               varchar(20) not null,
   detector_no          varchar(10) not null,
   ref_type             varchar(16),
   obs_time             datetime,
   exp_time             float,
   filename             varchar(128),
   file_path            varchar(256),
   qc1_status           tinyint(1),
   qc1_time             datetime,
   prc_status           tinyint(1),
   prc_time             datetime,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
387
388
389
   create_time          datetime
);

Wei Shoulin's avatar
Wei Shoulin committed
390
create table ifs_level1_data
Wei Shoulin's avatar
c3    
Wei Shoulin committed
391
392
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
393
394
395
396
397
398
399
400
401
402
403
404
   level0_id            varchar(20) not null,
   data_type            varchar(64) not null,
   cor_sci_id           int(20),
   prc_params           varchar(1024),
   filename             varchar(128),
   file_path            varchar(256),
   prc_status           tinyint(1),
   prc_time             datetime,
   qc1_status           tinyint(1),
   qc1_time             datetime,
   create_time          datetime,
   pipeline_id          varchar(60)
Wei Shoulin's avatar
c3    
Wei Shoulin committed
405
406
);

Wei Shoulin's avatar
Wei Shoulin committed
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
create table ifs_level1_ref (
  level1_id int(20) not null,
  ref_type varchar(64) not null,
  cal_id int(20) not null,
  primary key (level1_id, ref_type)
);

create table ifs_level1_header
(
   id                   int(20) not null,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);
create table ifs_level1_prc
(
   id                   integer PRIMARY KEY autoincrement,
   level1_id            int(20) not null,
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
   params_file_path     varchar(256),
   prc_status           int(2),
   prc_time             datetime,
   result_file_path            varchar(256)
);
Wei Shoulin's avatar
mci 0-1    
Wei Shoulin committed
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
/*===========================mci===================================*/
create table mci_level0_data
(
   id                   integer PRIMARY KEY autoincrement,
   level0_id            varchar(20) not null,
   obs_id               varchar(10) not null,
   detector_no          varchar(10) not null,
   obs_type             varchar(16),
   obs_time             datetime,
   exp_time             float,
   detector_status_id   int(20),
   filename             varchar(128),
   file_path            varchar(256),
   qc0_status           tinyint(1),
   qc0_time             datetime,
   prc_status           tinyint(1),
   prc_time             datetime,
   create_time          datetime
);

create table mci_level0_header
(
   id                   int(20) not null,
   ra                   float,
   "dec"                float,
Wei Shoulin's avatar
ifs ver    
Wei Shoulin committed
458
459
   object_name          varchar(64) not null,
   version              varchar(64) not null,
Wei Shoulin's avatar
mci 0-1    
Wei Shoulin committed
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
   primary key (id)
);

create table mci_level0_prc
(
   id                   integer PRIMARY KEY autoincrement,
   level0_id            varchar(20) not null,
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
   params_file_path     varchar(256),
   prc_status           int(2),
   prc_time             datetime,
   result_file_path            varchar(256)
);
create table mci_cal2level0
(
   merge_id             int(20) not null,
   level0_id            varchar(20) not null,
   primary key (merge_id, level0_id)
);

create table mci_cal_header
(
   id                   int(20) not null,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);

create table mci_cal_merge
(
   id                   integer PRIMARY KEY autoincrement,
   cal_id               varchar(20) not null,
   detector_no          varchar(10) not null,
   ref_type             varchar(16),
   obs_time             datetime,
   exp_time             float,
   filename             varchar(128),
   file_path            varchar(256),
   qc1_status           tinyint(1),
   qc1_time             datetime,
   prc_status           tinyint(1),
   prc_time             datetime,
   create_time          datetime
);

create table mci_level1_data
(
   id                   integer PRIMARY KEY autoincrement,
   level0_id            varchar(20) not null,
   data_type            varchar(64) not null,
   cor_sci_id           int(20),
   prc_params           varchar(1024),
   filename             varchar(128),
   file_path            varchar(256),
   prc_status           tinyint(1),
   prc_time             datetime,
   qc1_status           tinyint(1),
   qc1_time             datetime,
   create_time          datetime,
   pipeline_id          varchar(60)
);

create table mci_level1_ref (
  level1_id int(20) not null,
  ref_type varchar(64) not null,
  cal_id int(20) not null,
  primary key (level1_id, ref_type)
);

create table mci_level1_header
(
   id                   int(20) not null,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);
create table mci_level1_prc
(
   id                   integer PRIMARY KEY autoincrement,
   level1_id            int(20) not null,
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
   params_file_path     varchar(256),
   prc_status           int(2),
   prc_time             datetime,
   result_file_path            varchar(256)
);
Wei Shoulin's avatar
Wei Shoulin committed
550
551
/*===========================sls===================================*/
create table sls_level0_data
Wei Shoulin's avatar
c3    
Wei Shoulin committed
552
553
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
554
555
556
   level0_id            varchar(20) not null,
   obs_id               varchar(10) not null,
   detector_no          varchar(10) not null,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
557
558
559
560
561
562
563
564
565
566
567
568
569
   obs_type             varchar(16),
   obs_time             datetime,
   exp_time             float,
   detector_status_id   int(20),
   filename             varchar(128),
   file_path            varchar(256),
   qc0_status           tinyint(1),
   qc0_time             datetime,
   prc_status           tinyint(1),
   prc_time             datetime,
   create_time          datetime
);

Wei Shoulin's avatar
Wei Shoulin committed
570
create table sls_level0_header
Wei Shoulin's avatar
c3    
Wei Shoulin committed
571
572
573
574
575
576
577
578
(
   id                   int(20) not null,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);

Wei Shoulin's avatar
Wei Shoulin committed
579
create table sls_level0_prc
Wei Shoulin's avatar
c3    
Wei Shoulin committed
580
581
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
582
   level0_id            varchar(20) not null,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
583
584
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
Wei Shoulin's avatar
Wei Shoulin committed
585
   params_file_path     varchar(256),
Wei Shoulin's avatar
c3    
Wei Shoulin committed
586
587
   prc_status           int(2),
   prc_time             datetime,
Wei Shoulin's avatar
Wei Shoulin committed
588
   result_file_path            varchar(256)
Wei Shoulin's avatar
c3    
Wei Shoulin committed
589
);
Wei Shoulin's avatar
Wei Shoulin committed
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
create table sls_cal2level0
(
   merge_id             int(20) not null,
   level0_id            varchar(20) not null,
   primary key (merge_id, level0_id)
);

create table sls_cal_header
(
   id                   int(20) not null,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);

create table sls_cal_merge
(
   id                   integer PRIMARY KEY autoincrement,
   cal_id               varchar(20) not null,
   detector_no          varchar(10) not null,
   ref_type             varchar(16),
   obs_time             datetime,
   exp_time             float,
   filename             varchar(128),
   file_path            varchar(256),
   qc1_status           tinyint(1),
   qc1_time             datetime,
   prc_status           tinyint(1),
   prc_time             datetime,
   create_time          datetime
);

create table sls_level1_data
(
   id                   integer PRIMARY KEY autoincrement,
   level0_id            varchar(20) not null,
   data_type            varchar(64) not null,
   prc_params           varchar(1024),
   filename             varchar(128),
   file_path            varchar(256),
   prc_status           tinyint(1),
   prc_time             datetime,
   qc1_status           tinyint(1),
   qc1_time             datetime,
   create_time          datetime,
   pipeline_id          varchar(60)
);

create table sls_level1_ref (
  level1_id int(20) not null,
  ref_type varchar(64) not null,
  cal_id int(20) not null,
  primary key (level1_id, ref_type)
);

create table sls_level1_header
(
   id                   int(20) not null,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);

create table sls_level1_prc
Wei Shoulin's avatar
Wei Shoulin committed
656
657
658
659
660
661
662
663
(
   id                   integer PRIMARY KEY autoincrement,
   level1_id            int(20) not null,
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
   params_file_path     varchar(256),
   prc_status           int(2),
   prc_time             datetime,
Wei Shoulin's avatar
Wei Shoulin committed
664
   result_file_path     varchar(256)
Wei Shoulin's avatar
Wei Shoulin committed
665
);
Wei Shoulin's avatar
Wei Shoulin committed
666
667

create table sls_level2_spectra
Wei Shoulin's avatar
c3    
Wei Shoulin committed
668
669
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
670
671
672
673
674
675
676
677
678
679
680
   spectra_id           varchar(40),
   level1_id            int(20) not null,
   region               varchar(128),
   filename             varchar(128),
   file_path            varchar(256),
   prc_status           tinyint(1),
   prc_time             datetime,
   qc1_status           tinyint(1),
   qc1_time             datetime,
   create_time          datetime,
   pipeline_id          varchar(60)
Wei Shoulin's avatar
c3    
Wei Shoulin committed
681
);
Wei Shoulin's avatar
Wei Shoulin committed
682
create table sls_level2_spectra_header
Wei Shoulin's avatar
c3    
Wei Shoulin committed
683
(
Wei Shoulin's avatar
Wei Shoulin committed
684
   id                   int(20) not null,
Wei Shoulin's avatar
Wei Shoulin committed
685
686
687
688
689
690
691
692
693
694
695
696
697
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);
/*===========================cpic===================================*/
create table cpic_level0_data
(
   id                   integer PRIMARY KEY autoincrement,
   level0_id            varchar(20) not null,
   obs_id               varchar(10) not null,
   detector_no          varchar(10) not null,
   obs_type             varchar(16),
Wei Shoulin's avatar
c3    
Wei Shoulin committed
698
699
   obs_time             datetime,
   exp_time             float,
Wei Shoulin's avatar
Wei Shoulin committed
700
701
702
703
704
705
706
707
708
709
710
711
712
   detector_status_id   int(20),
   filename             varchar(128),
   file_path            varchar(256),
   qc0_status           tinyint(1),
   qc0_time             datetime,
   prc_status           tinyint(1),
   prc_time             datetime,
   create_time          datetime
);

create table cpic_level0_header
(
   id                   int(20) not null,
Wei Shoulin's avatar
Wei Shoulin committed
713
714
   ra                   float,
   "dec"                float,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
715
   create_time          datetime,
Wei Shoulin's avatar
Wei Shoulin committed
716
   primary key (id)
Wei Shoulin's avatar
c3    
Wei Shoulin committed
717
718
);

Wei Shoulin's avatar
Wei Shoulin committed
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
create table cpic_level0_prc
(
   id                   integer PRIMARY KEY autoincrement,
   level0_id            varchar(20) not null,
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
   params_file_path     varchar(256),
   prc_status           int(2),
   prc_time             datetime,
   result_file_path            varchar(256)
);
create table cpic_cal2level0
(
   merge_id             int(20) not null,
   level0_id            varchar(20) not null,
   primary key (merge_id, level0_id)
);

create table cpic_cal_header
(
   id                   int(20) not null,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);

create table cpic_cal_merge
(
   id                   integer PRIMARY KEY autoincrement,
   cal_id               varchar(20) not null,
   detector_no          varchar(10) not null,
   ref_type             varchar(16),
   obs_time             datetime,
   exp_time             float,
   filename             varchar(128),
   file_path            varchar(256),
   qc1_status           tinyint(1),
   qc1_time             datetime,
   prc_status           tinyint(1),
   prc_time             datetime,
   create_time          datetime
);

create table cpic_level1_data
(
   id                   integer PRIMARY KEY autoincrement,
   level0_id            varchar(20) not null,
   data_type            varchar(64) not null,
   prc_params           varchar(1024),
   filename             varchar(128),
   file_path            varchar(256),
   prc_status           tinyint(1),
   prc_time             datetime,
   qc1_status           tinyint(1),
   qc1_time             datetime,
   create_time          datetime,
   pipeline_id          varchar(60)
);

create table cpic_level1_ref (
  level1_id int(20) not null,
  ref_type varchar(64) not null,
  cal_id int(20) not null,
  primary key (level1_id, ref_type)
);

create table cpic_level1_header
(
   id                   int(20) not null,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);

create table cpic_level1_prc
(
   id                   integer PRIMARY KEY autoincrement,
   level1_id            int(20) not null,
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
   params_file_path     varchar(256),
   prc_status           int(2),
   prc_time             datetime,
   result_file_path     varchar(256)
);