forked from tagbase/tagbase
/
tagbase-schema-0.2.sql
1736 lines (1295 loc) · 90.2 KB
/
tagbase-schema-0.2.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
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
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
458
459
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
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
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
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
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
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- TAGBASE v1.0 for PostgreSQL & eTUFF (electronic Tag Universal File Format): Complete database definition schema, including Tag metadata and variable Code tables
-- Product of the Oceanographic In-situ Data Interoperability Project (OIIP) funded under NASA/ACCESS-15 Program, June 2018
--
-- By executing this script you will be able to create virgin Tagbase database with the necessary information populated in key code tables to be able ingest electronic tagging data in the eTUFF format
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.3
-- Dumped by pg_dump version 10.1
-- Started on 2018-06-12 18:25:22
CREATE ROLE tagbase WITH SUPERUSER LOGIN;
CREATE DATABASE tagbase WITH OWNER = 'tagbase';
\connect tagbase
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- TOC entry 195 (class 1259 OID 184670)
-- Name: data_histogram_bin_data; Type: TABLE; Schema: public; Owner: tagbase
--
CREATE TABLE data_histogram_bin_data (
submission_id bigint NOT NULL,
tag_id bigint NOT NULL,
bin_id bigint NOT NULL,
bin_class integer NOT NULL,
date_time timestamp(6) with time zone NOT NULL,
variable_value double precision NOT NULL,
position_date_time timestamp(6) with time zone,
variable_id bigint NOT NULL
);
ALTER TABLE data_histogram_bin_data OWNER TO tagbase;
--
-- TOC entry 2230 (class 0 OID 0)
-- Dependencies: 195
-- Name: TABLE data_histogram_bin_data; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON TABLE data_histogram_bin_data IS 'Conatins the frequency for corresponding summary data binning schemes (migrated from proc_observations)';
--
-- TOC entry 2231 (class 0 OID 0)
-- Dependencies: 195
-- Name: COLUMN data_histogram_bin_data.submission_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_histogram_bin_data.submission_id IS 'Unique numeric ID assigned upon submission of a tag eTUFF data file for ingest/importation into Tagbase';
--
-- TOC entry 2232 (class 0 OID 0)
-- Dependencies: 195
-- Name: COLUMN data_histogram_bin_data.tag_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_histogram_bin_data.tag_id IS 'Unique numeric Tag ID associated with the ingested tag data file';
--
-- TOC entry 2233 (class 0 OID 0)
-- Dependencies: 195
-- Name: COLUMN data_histogram_bin_data.bin_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_histogram_bin_data.bin_id IS 'Unique bin ID for the summary bin-frequency class';
--
-- TOC entry 2234 (class 0 OID 0)
-- Dependencies: 195
-- Name: COLUMN data_histogram_bin_data.bin_class; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_histogram_bin_data.bin_class IS 'Sequential numeric bin class identifier';
--
-- TOC entry 2235 (class 0 OID 0)
-- Dependencies: 195
-- Name: COLUMN data_histogram_bin_data.date_time; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_histogram_bin_data.date_time IS 'Date/time stamp of the tag summarized bin-frequency data record';
--
-- TOC entry 2236 (class 0 OID 0)
-- Dependencies: 195
-- Name: COLUMN data_histogram_bin_data.variable_value; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_histogram_bin_data.variable_value IS 'Aggregate measure for the given bin-interval of the geophysical value of the observed tag variable record';
--
-- TOC entry 2237 (class 0 OID 0)
-- Dependencies: 195
-- Name: COLUMN data_histogram_bin_data.position_date_time; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_histogram_bin_data.position_date_time IS 'Date/time stamp of nearest matched associated positional record';
--
-- TOC entry 2238 (class 0 OID 0)
-- Dependencies: 195
-- Name: COLUMN data_histogram_bin_data.variable_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_histogram_bin_data.variable_id IS 'Unique variable identifier for the data record from the source eTUFF file ingested. The variable_id is based on observation or measurment variables listed in the observation_types table. Note that records in this table are NOT expected to be equivalent to those in the variable_id column of the data_histogram_bin_info table';
--
-- TOC entry 194 (class 1259 OID 184660)
-- Name: data_histogram_bin_info; Type: TABLE; Schema: public; Owner: tagbase
--
CREATE TABLE data_histogram_bin_info (
bin_id bigint NOT NULL,
bin_class integer NOT NULL,
min_value double precision NOT NULL,
max_value double precision NOT NULL,
variable_id bigint NOT NULL
);
ALTER TABLE data_histogram_bin_info OWNER TO tagbase;
--
-- TOC entry 2239 (class 0 OID 0)
-- Dependencies: 194
-- Name: TABLE data_histogram_bin_info; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON TABLE data_histogram_bin_info IS 'Contains definitions of binning schemes for summary tag data (migrated from proc_observations)';
--
-- TOC entry 2240 (class 0 OID 0)
-- Dependencies: 194
-- Name: COLUMN data_histogram_bin_info.bin_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_histogram_bin_info.bin_id IS 'Unique bin ID for the summary bin-frequency class';
--
-- TOC entry 2241 (class 0 OID 0)
-- Dependencies: 194
-- Name: COLUMN data_histogram_bin_info.bin_class; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_histogram_bin_info.bin_class IS 'Sequential numeric bin class identifier';
--
-- TOC entry 2242 (class 0 OID 0)
-- Dependencies: 194
-- Name: COLUMN data_histogram_bin_info.min_value; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_histogram_bin_info.min_value IS 'Value of minimum/lower bound of bin interval';
--
-- TOC entry 2243 (class 0 OID 0)
-- Dependencies: 194
-- Name: COLUMN data_histogram_bin_info.max_value; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_histogram_bin_info.max_value IS 'Value of maximum/upper bound of bin interval';
--
-- TOC entry 2244 (class 0 OID 0)
-- Dependencies: 194
-- Name: COLUMN data_histogram_bin_info.variable_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_histogram_bin_info.variable_id IS 'Unique variable identifier for the data record from the source eTUFF file ingested. The variable_id is based on observation or measurment variables listed in the observation_types table. Note that records in this table are NOT expected to be equivalent to those in the variable_id column of the data_histogram_bin_data table';
--
-- TOC entry 192 (class 1259 OID 184628)
-- Name: data_position; Type: TABLE; Schema: public; Owner: tagbase
--
CREATE TABLE data_position (
date_time timestamp(6) with time zone NOT NULL,
lat double precision NOT NULL,
lon double precision NOT NULL,
lat_err double precision,
lon_err double precision,
submission_id bigint NOT NULL,
tag_id bigint NOT NULL
);
ALTER TABLE data_position OWNER TO tagbase;
--
-- TOC entry 2245 (class 0 OID 0)
-- Dependencies: 192
-- Name: TABLE data_position; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON TABLE data_position IS 'Contains the tag positional data series with associated Lat/Lon error estimates where available (migrated from proc_observations)';
--
-- TOC entry 2246 (class 0 OID 0)
-- Dependencies: 192
-- Name: COLUMN data_position.date_time; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_position.date_time IS 'Date/time stamp of the tag positional data record';
--
-- TOC entry 2247 (class 0 OID 0)
-- Dependencies: 192
-- Name: COLUMN data_position.lat; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_position.lat IS 'Latitude in decimal degrees of the positional data tag record';
--
-- TOC entry 2248 (class 0 OID 0)
-- Dependencies: 192
-- Name: COLUMN data_position.lon; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_position.lon IS 'Longitude in decimal degrees of the positional data tag record';
--
-- TOC entry 2249 (class 0 OID 0)
-- Dependencies: 192
-- Name: COLUMN data_position.lat_err; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_position.lat_err IS 'Error associated with the tag record Laitudiinal positional estimate';
--
-- TOC entry 2250 (class 0 OID 0)
-- Dependencies: 192
-- Name: COLUMN data_position.lon_err; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_position.lon_err IS 'Error associated with the tag record Longitudinal positional estimate';
--
-- TOC entry 2251 (class 0 OID 0)
-- Dependencies: 192
-- Name: COLUMN data_position.submission_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_position.submission_id IS 'Unique numeric ID assigned upon submission of a tag eTUFF data file for ingest/importation into Tagbase';
--
-- TOC entry 2252 (class 0 OID 0)
-- Dependencies: 192
-- Name: COLUMN data_position.tag_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_position.tag_id IS 'Unique numeric Tag ID associated with the ingested tag data file';
--
-- TOC entry 196 (class 1259 OID 184683)
-- Name: data_profile; Type: TABLE; Schema: public; Owner: tagbase
--
CREATE TABLE data_profile (
submission_id bigint NOT NULL,
tag_id bigint NOT NULL,
variable_id bigint NOT NULL,
date_time timestamp(6) with time zone NOT NULL,
depth double precision NOT NULL,
variable_value double precision NOT NULL,
position_date_time timestamp(6) with time zone
);
ALTER TABLE data_profile OWNER TO tagbase;
--
-- TOC entry 2253 (class 0 OID 0)
-- Dependencies: 196
-- Name: TABLE data_profile; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON TABLE data_profile IS 'Contains the summarized bin profile tag observations (migrated from proc_observations)';
--
-- TOC entry 2254 (class 0 OID 0)
-- Dependencies: 196
-- Name: COLUMN data_profile.submission_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_profile.submission_id IS 'Unique numeric ID assigned upon submission of a tag eTUFF data file for ingest/importation into Tagbase';
--
-- TOC entry 2255 (class 0 OID 0)
-- Dependencies: 196
-- Name: COLUMN data_profile.tag_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_profile.tag_id IS 'Unique numeric Tag ID associated with the ingested tag data file';
--
-- TOC entry 2256 (class 0 OID 0)
-- Dependencies: 196
-- Name: COLUMN data_profile.variable_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_profile.variable_id IS 'Unique variable identifier for the data record from the source eTUFF file ingested. The variable_id is based on observation or measurment variables listed in the observation_types table';
--
-- TOC entry 2257 (class 0 OID 0)
-- Dependencies: 196
-- Name: COLUMN data_profile.date_time; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_profile.date_time IS 'Date/time stamp of the tag data record';
--
-- TOC entry 2258 (class 0 OID 0)
-- Dependencies: 196
-- Name: COLUMN data_profile.depth; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_profile.depth IS 'Depth of the tag data record';
--
-- TOC entry 2259 (class 0 OID 0)
-- Dependencies: 196
-- Name: COLUMN data_profile.variable_value; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_profile.variable_value IS 'Geophysical value of the observed tag variable record';
--
-- TOC entry 2260 (class 0 OID 0)
-- Dependencies: 196
-- Name: COLUMN data_profile.position_date_time; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_profile.position_date_time IS 'Date/time stamp of nearest matched associated positional record';
--
-- TOC entry 193 (class 1259 OID 184636)
-- Name: data_time_series; Type: TABLE; Schema: public; Owner: tagbase
--
CREATE TABLE data_time_series (
date_time timestamp(6) with time zone NOT NULL,
variable_id bigint NOT NULL,
variable_value double precision NOT NULL,
submission_id bigint NOT NULL,
tag_id bigint NOT NULL,
position_date_time timestamp(6) with time zone
);
ALTER TABLE data_time_series OWNER TO tagbase;
--
-- TOC entry 2261 (class 0 OID 0)
-- Dependencies: 193
-- Name: TABLE data_time_series; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON TABLE data_time_series IS 'Contains the continuous measurement archival time series of tag geophysical measurments (migrated from proc_observations)';
--
-- TOC entry 2262 (class 0 OID 0)
-- Dependencies: 193
-- Name: COLUMN data_time_series.date_time; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_time_series.date_time IS 'Date/time stamp of the tag data record';
--
-- TOC entry 2263 (class 0 OID 0)
-- Dependencies: 193
-- Name: COLUMN data_time_series.variable_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_time_series.variable_id IS 'Unique variable identifier for the data record from the source eTUFF file ingested. The variable_id is based on observation or measurment variables listed in the observation_types table';
--
-- TOC entry 2264 (class 0 OID 0)
-- Dependencies: 193
-- Name: COLUMN data_time_series.variable_value; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_time_series.variable_value IS 'Geophysical value of the observed tag variable record';
--
-- TOC entry 2265 (class 0 OID 0)
-- Dependencies: 193
-- Name: COLUMN data_time_series.submission_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_time_series.submission_id IS 'Unique numeric ID assigned upon submission of a tag eTUFF data file for ingest/importation into Tagbase';
--
-- TOC entry 2266 (class 0 OID 0)
-- Dependencies: 193
-- Name: COLUMN data_time_series.tag_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_time_series.tag_id IS 'Unique numeric Tag ID associated with the ingested tag data file';
--
-- TOC entry 2267 (class 0 OID 0)
-- Dependencies: 193
-- Name: COLUMN data_time_series.position_date_time; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN data_time_series.position_date_time IS 'Date/time stamp of nearest matched associated positional record';
--
-- TOC entry 191 (class 1259 OID 184612)
-- Name: metadata; Type: TABLE; Schema: public; Owner: tagbase
--
CREATE TABLE metadata (
submission_id bigint NOT NULL,
attribute_id bigint NOT NULL,
attribute_value text NOT NULL,
tag_id bigint NOT NULL
);
ALTER TABLE metadata OWNER TO tagbase;
--
-- TOC entry 2268 (class 0 OID 0)
-- Dependencies: 191
-- Name: TABLE metadata; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON TABLE metadata IS 'Contains the ingested tag metadata consistent with the eTUFF specification';
--
-- TOC entry 2269 (class 0 OID 0)
-- Dependencies: 191
-- Name: COLUMN metadata.submission_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN metadata.submission_id IS 'Unique numeric ID assigned upon submission of a tag eTUFF data file for ingest/importation into Tagbase';
--
-- TOC entry 2270 (class 0 OID 0)
-- Dependencies: 191
-- Name: COLUMN metadata.attribute_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN metadata.attribute_id IS 'Unique numeric metadata atttribute ID based on the eTUFF metadata specification';
--
-- TOC entry 2271 (class 0 OID 0)
-- Dependencies: 191
-- Name: COLUMN metadata.attribute_value; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN metadata.attribute_value IS 'Value associated with the given eTUFF metadata attribute';
--
-- TOC entry 2272 (class 0 OID 0)
-- Dependencies: 191
-- Name: COLUMN metadata.tag_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN metadata.tag_id IS 'Unique numeric Tag ID associated with the ingested tag data file';
--
-- TOC entry 190 (class 1259 OID 184604)
-- Name: metadata_types; Type: TABLE; Schema: public; Owner: tagbase
--
CREATE TABLE metadata_types (
attribute_id bigint NOT NULL,
category character varying(1024) NOT NULL,
attribute_name character varying(1024) NOT NULL,
type character varying(1024) NOT NULL,
description text NOT NULL,
example text,
comments text,
necessity character varying(1024) NOT NULL
);
ALTER TABLE metadata_types OWNER TO tagbase;
--
-- TOC entry 2273 (class 0 OID 0)
-- Dependencies: 190
-- Name: TABLE metadata_types; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON TABLE metadata_types IS 'Contains descriptive information on tag metadata based on the eTUFF specification';
--
-- TOC entry 2274 (class 0 OID 0)
-- Dependencies: 190
-- Name: COLUMN metadata_types.attribute_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN metadata_types.attribute_id IS 'Unique numeric metadata atttribute ID based on the eTUFF metadata specification';
--
-- TOC entry 2275 (class 0 OID 0)
-- Dependencies: 190
-- Name: COLUMN metadata_types.category; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN metadata_types.category IS 'Metadata attribute category or group based on the eTUFF metadata specification';
--
-- TOC entry 2276 (class 0 OID 0)
-- Dependencies: 190
-- Name: COLUMN metadata_types.attribute_name; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN metadata_types.attribute_name IS 'Name of metadata attribute based on the eTUFF metadata specification';
--
-- TOC entry 2277 (class 0 OID 0)
-- Dependencies: 190
-- Name: COLUMN metadata_types.type; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN metadata_types.type IS 'Metadata attribute format type based on the eTUFF metadata specification';
--
-- TOC entry 2278 (class 0 OID 0)
-- Dependencies: 190
-- Name: COLUMN metadata_types.description; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN metadata_types.description IS 'Description of metadata attribute based on the eTUFF metadata specification';
--
-- TOC entry 2279 (class 0 OID 0)
-- Dependencies: 190
-- Name: COLUMN metadata_types.example; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN metadata_types.example IS 'Example value of metadata attribute on the eTUFF metadata specification';
--
-- TOC entry 2280 (class 0 OID 0)
-- Dependencies: 190
-- Name: COLUMN metadata_types.comments; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN metadata_types.comments IS 'Comments or notes relating to the metadata attribute based on the eTUFF metadata specification';
--
-- TOC entry 2281 (class 0 OID 0)
-- Dependencies: 190
-- Name: COLUMN metadata_types.necessity; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN metadata_types.necessity IS 'Deisgnation of the metadata attribute as Required, Recommended, or Optional based on the eTUFF metadata specification';
--
-- TOC entry 188 (class 1259 OID 184580)
-- Name: observation_types; Type: TABLE; Schema: public; Owner: tagbase
--
CREATE TABLE observation_types (
variable_id bigint NOT NULL,
variable_name character varying(255) NOT NULL,
standard_name character varying(255),
variable_source character varying(255),
variable_units character varying(255),
notes text,
standard_unit character varying(255)
);
ALTER TABLE observation_types OWNER TO tagbase;
--
-- TOC entry 2282 (class 0 OID 0)
-- Dependencies: 188
-- Name: TABLE observation_types; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON TABLE observation_types IS 'Contains listings and descriptions of observation variable types based on the eTUFF specification';
--
-- TOC entry 2283 (class 0 OID 0)
-- Dependencies: 188
-- Name: COLUMN observation_types.variable_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN observation_types.variable_id IS 'Unique variable identifier based on the eTUFF tag data file specification';
--
-- TOC entry 2284 (class 0 OID 0)
-- Dependencies: 188
-- Name: COLUMN observation_types.variable_name; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN observation_types.variable_name IS 'Variable name based on the eTUFF tag data file specification';
--
-- TOC entry 2285 (class 0 OID 0)
-- Dependencies: 188
-- Name: COLUMN observation_types.standard_name; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN observation_types.standard_name IS 'CF Standard name for observation variable, if available';
--
-- TOC entry 2286 (class 0 OID 0)
-- Dependencies: 188
-- Name: COLUMN observation_types.variable_source; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN observation_types.variable_source IS 'Source authority for the given variables';
--
-- TOC entry 2287 (class 0 OID 0)
-- Dependencies: 188
-- Name: COLUMN observation_types.variable_units; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN observation_types.variable_units IS 'Units of the variable based on the eTUFF tag data file specification';
--
-- TOC entry 2288 (class 0 OID 0)
-- Dependencies: 188
-- Name: COLUMN observation_types.notes; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN observation_types.notes IS 'Notes or comments relating to the variable';
--
-- TOC entry 2289 (class 0 OID 0)
-- Dependencies: 188
-- Name: COLUMN observation_types.standard_unit; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN observation_types.standard_unit IS 'CF canonical standard unit for observation variable, if available';
--
-- TOC entry 187 (class 1259 OID 184578)
-- Name: observation_types_variable_id_seq; Type: SEQUENCE; Schema: public; Owner: tagbase
--
CREATE SEQUENCE observation_types_variable_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE observation_types_variable_id_seq OWNER TO tagbase;
--
-- TOC entry 2290 (class 0 OID 0)
-- Dependencies: 187
-- Name: observation_types_variable_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: tagbase
--
ALTER SEQUENCE observation_types_variable_id_seq OWNED BY observation_types.variable_id;
--
-- TOC entry 189 (class 1259 OID 184591)
-- Name: proc_observations; Type: TABLE; Schema: public; Owner: tagbase
--
CREATE TABLE proc_observations (
date_time timestamp(6) with time zone NOT NULL,
variable_id bigint NOT NULL,
variable_value double precision NOT NULL,
submission_id bigint NOT NULL,
tag_id bigint NOT NULL
);
ALTER TABLE proc_observations OWNER TO tagbase;
--
-- TOC entry 2291 (class 0 OID 0)
-- Dependencies: 189
-- Name: TABLE proc_observations; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON TABLE proc_observations IS 'Contains staged source tag eTUFF data imported into Tagbase';
--
-- TOC entry 2292 (class 0 OID 0)
-- Dependencies: 189
-- Name: COLUMN proc_observations.date_time; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN proc_observations.date_time IS 'Date/time stamp of data record from source eTUFF file ingested';
--
-- TOC entry 2293 (class 0 OID 0)
-- Dependencies: 189
-- Name: COLUMN proc_observations.variable_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN proc_observations.variable_id IS 'Unique variable identifier for the data record from the source eTUFF file ingested. The variable_id is based on observation or measurment variables listed in the observation_types table';
--
-- TOC entry 2294 (class 0 OID 0)
-- Dependencies: 189
-- Name: COLUMN proc_observations.variable_value; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN proc_observations.variable_value IS 'Geophysical value of the given measured variable for the eTUFF data record';
--
-- TOC entry 2295 (class 0 OID 0)
-- Dependencies: 189
-- Name: COLUMN proc_observations.submission_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN proc_observations.submission_id IS 'Unique numeric ID assigned upon submission of a tag eTUFF data file for ingest/importation into Tagbase';
--
-- TOC entry 2296 (class 0 OID 0)
-- Dependencies: 189
-- Name: COLUMN proc_observations.tag_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN proc_observations.tag_id IS 'Unique numeric Tag ID associated with the ingested tag data file';
--
-- TOC entry 186 (class 1259 OID 184571)
-- Name: submission; Type: TABLE; Schema: public; Owner: tagbase
--
CREATE TABLE submission (
submission_id bigint NOT NULL,
tag_id bigint NOT NULL,
dmas_granule_id bigint,
date_time timestamp(6) with time zone DEFAULT now() NOT NULL,
filename character varying(255) NOT NULL,
version character varying(50)
);
ALTER TABLE submission OWNER TO tagbase;
--
-- TOC entry 2297 (class 0 OID 0)
-- Dependencies: 186
-- Name: TABLE submission; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON TABLE submission IS 'Contains information on source tag eTUFF files submitted for ingest into Tagbase';
--
-- TOC entry 2298 (class 0 OID 0)
-- Dependencies: 186
-- Name: COLUMN submission.submission_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN submission.submission_id IS 'Unique numeric ID assigned upon submission of a tag eTUFF data file for ingest/importation into Tagbase';
--
-- TOC entry 2299 (class 0 OID 0)
-- Dependencies: 186
-- Name: COLUMN submission.tag_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN submission.tag_id IS 'Unique numeric Tag ID associated with the ingested tag eTUFF data file';
--
-- TOC entry 2300 (class 0 OID 0)
-- Dependencies: 186
-- Name: COLUMN submission.dmas_granule_id; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN submission.dmas_granule_id IS 'Unique numeric file identifier in the PODAAC DMAS catalog for the ingested tag eTUFF data file';
--
-- TOC entry 2301 (class 0 OID 0)
-- Dependencies: 186
-- Name: COLUMN submission.date_time; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN submission.date_time IS 'Local datetime stamp at the time of eTUFF tag data file ingestion';
--
-- TOC entry 2302 (class 0 OID 0)
-- Dependencies: 186
-- Name: COLUMN submission.filename; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN submission.filename IS 'Full name and extension of the ingested eTUFF tag data file';
--
-- TOC entry 2303 (class 0 OID 0)
-- Dependencies: 186
-- Name: COLUMN submission.version; Type: COMMENT; Schema: public; Owner: tagbase
--
COMMENT ON COLUMN submission.version IS 'Version identifier for the eTUFF tag data file ingested';
--
-- TOC entry 185 (class 1259 OID 184569)
-- Name: submission_submission_id_seq; Type: SEQUENCE; Schema: public; Owner: tagbase
--
CREATE SEQUENCE submission_submission_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE submission_submission_id_seq OWNER TO tagbase;
--
-- TOC entry 2304 (class 0 OID 0)
-- Dependencies: 185
-- Name: submission_submission_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: tagbase
--
ALTER SEQUENCE submission_submission_id_seq OWNED BY submission.submission_id;
--
-- TOC entry 197 (class 1259 OID 184696)
-- Name: submission_tag_id_seq; Type: SEQUENCE; Schema: public; Owner: tagbase
--
CREATE SEQUENCE submission_tag_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE submission_tag_id_seq OWNER TO tagbase;
--
-- TOC entry 2046 (class 2604 OID 184583)
-- Name: observation_types variable_id; Type: DEFAULT; Schema: public; Owner: tagbase
--
ALTER TABLE ONLY observation_types ALTER COLUMN variable_id SET DEFAULT nextval('observation_types_variable_id_seq'::regclass);
--
-- TOC entry 2044 (class 2604 OID 184574)
-- Name: submission submission_id; Type: DEFAULT; Schema: public; Owner: tagbase
--
ALTER TABLE ONLY submission ALTER COLUMN submission_id SET DEFAULT nextval('submission_submission_id_seq'::regclass);
--
-- TOC entry 2222 (class 0 OID 184670)
-- Dependencies: 195
-- Data for Name: data_histogram_bin_data; Type: TABLE DATA; Schema: public; Owner: tagbase
--
COPY data_histogram_bin_data (submission_id, tag_id, bin_id, bin_class, date_time, variable_value, position_date_time, variable_id) FROM stdin;
\.
--
-- TOC entry 2221 (class 0 OID 184660)
-- Dependencies: 194
-- Data for Name: data_histogram_bin_info; Type: TABLE DATA; Schema: public; Owner: tagbase
--
COPY data_histogram_bin_info (bin_id, bin_class, min_value, max_value, variable_id) FROM stdin;
\.
--
-- TOC entry 2219 (class 0 OID 184628)
-- Dependencies: 192
-- Data for Name: data_position; Type: TABLE DATA; Schema: public; Owner: tagbase
--
COPY data_position (date_time, lat, lon, lat_err, lon_err, submission_id, tag_id) FROM stdin;
\.
--
-- TOC entry 2223 (class 0 OID 184683)
-- Dependencies: 196
-- Data for Name: data_profile; Type: TABLE DATA; Schema: public; Owner: tagbase
--
COPY data_profile (submission_id, tag_id, variable_id, date_time, depth, variable_value, position_date_time) FROM stdin;
\.
--
-- TOC entry 2220 (class 0 OID 184636)
-- Dependencies: 193
-- Data for Name: data_time_series; Type: TABLE DATA; Schema: public; Owner: tagbase
--
COPY data_time_series (date_time, variable_id, variable_value, submission_id, tag_id, position_date_time) FROM stdin;
\.
--
-- TOC entry 2218 (class 0 OID 184612)
-- Dependencies: 191
-- Data for Name: metadata; Type: TABLE DATA; Schema: public; Owner: tagbase
--
COPY metadata (submission_id, attribute_id, attribute_value, tag_id) FROM stdin;