-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrc.sql
1102 lines (929 loc) · 43.2 KB
/
trc.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
-- phpMyAdmin SQL Dump
-- version 4.9.11
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: May 08, 2023 at 03:51 PM
-- Server version: 5.7.42
-- PHP Version: 7.4.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `stuchalk_trc`
--
-- --------------------------------------------------------
--
-- Table structure for table `chemicals`
--
CREATE TABLE `chemicals` (
`id` mediumint(6) UNSIGNED ZEROFILL NOT NULL,
`file_id` smallint(5) UNSIGNED ZEROFILL NOT NULL,
`substance_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL,
`orgnum` tinyint(3) UNSIGNED NOT NULL,
`sourcetype` enum('Commercial source','Synthesized by the authors','Synthesized by others','Standard Reference Material (SRM)','Isolated from a natural product','Not stated in the document','No sample used') COLLATE utf8mb4_bin DEFAULT NULL,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Table of chemicals from ThermoML files';
-- --------------------------------------------------------
--
-- Table structure for table `chemicals_datasets`
--
CREATE TABLE `chemicals_datasets` (
`id` mediumint(8) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`chemical_id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {chemicals}',
`dataset_id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {datasets}',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Join table for chemicals and datasets';
-- --------------------------------------------------------
--
-- Table structure for table `components`
--
CREATE TABLE `components` (
`id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key',
`chemical_id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {chemicals}',
`mixture_id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {mixtures}',
`compnum` tinyint(2) UNSIGNED DEFAULT NULL COMMENT 'component index',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- --------------------------------------------------------
--
-- Table structure for table `conditions`
--
CREATE TABLE `conditions` (
`id` mediumint(7) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`dataset_id` mediumint(6) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {datasets}',
`dataseries_id` mediumint(6) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {dataseries}',
`datapoint_id` mediumint(7) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {datapoints}',
`quantity_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {quantities}',
`system_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {systems}',
`component_id` mediumint(6) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {component}',
`phase_id` mediumint(6) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {phases}',
`number` tinytext COLLATE utf8mb4_bin COMMENT 'numeric value in sci. not. as text',
`significand` tinytext COLLATE utf8mb4_bin COMMENT 'significand as text',
`exponent` tinytext COLLATE utf8mb4_bin COMMENT 'exponent as text',
`unit_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {units}',
`accuracy` tinyint(2) DEFAULT NULL COMMENT '# of sig. digits as int',
`exact` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'exact value (boolean)',
`text` varchar(128) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'text of numeric value from XML',
`issue` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'any issue with data?',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPACT;
-- --------------------------------------------------------
--
-- Table structure for table `crosswalks`
--
CREATE TABLE `crosswalks` (
`id` mediumint(7) UNSIGNED ZEROFILL NOT NULL,
`context_id` smallint(5) UNSIGNED ZEROFILL NOT NULL,
`dataset_id` smallint(5) UNSIGNED ZEROFILL NOT NULL,
`table` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
`field` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
`ontterm_id` int(5) UNSIGNED ZEROFILL NOT NULL,
`sdsection` enum('metadata','methodology','system','dataset','other') COLLATE utf8_unicode_ci DEFAULT NULL,
`sdsubsection` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Table of crosswalk data for the ChEMBL data';
-- --------------------------------------------------------
--
-- Table structure for table `data`
--
CREATE TABLE `data` (
`id` mediumint(8) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`dataset_id` mediumint(6) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {datasets}',
`dataseries_id` mediumint(6) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {dataseries}',
`datapoint_id` mediumint(7) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {datapoints}',
`quantity_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {quantities}',
`sampleprop_id` mediumint(7) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {sampleprops}',
`component_id` mediumint(6) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {components}',
`phase_id` mediumint(6) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {phases}',
`number` tinytext COLLATE utf8mb4_bin COMMENT 'numeric value in sci. not. as text',
`significand` tinytext COLLATE utf8mb4_bin COMMENT 'significand as text',
`exponent` tinytext COLLATE utf8mb4_bin COMMENT 'exponent as text',
`error` tinytext COLLATE utf8mb4_bin COMMENT 'uncertainty as text',
`error_type` enum('absolute','relative','SD','%RSD','CI') COLLATE utf8mb4_bin NOT NULL DEFAULT 'absolute' COMMENT 'uncertainty type as enum',
`unit_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {units}',
`accuracy` tinyint(2) DEFAULT NULL COMMENT '# of sig. digits as int',
`exact` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'exact value (boolean)',
`text` varchar(128) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'text of numeric value from XML',
`issue` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'any issue with data?',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPACT;
-- --------------------------------------------------------
--
-- Table structure for table `datapoints`
--
CREATE TABLE `datapoints` (
`id` mediumint(7) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`dataset_id` mediumint(6) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {datasets}',
`dataseries_id` mediumint(6) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {dataseries}',
`row_index` varchar(10) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'index of point in series',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPACT;
-- --------------------------------------------------------
--
-- Table structure for table `dataseries`
--
CREATE TABLE `dataseries` (
`id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`dataset_id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {datasets}',
`idx` smallint(5) UNSIGNED NOT NULL COMMENT 'index of series in dataset',
`points` smallint(5) UNSIGNED DEFAULT NULL COMMENT 'number of points in series',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Dataseries are part of a dataset and are made up of data' ROW_FORMAT=COMPACT;
-- --------------------------------------------------------
--
-- Table structure for table `datasets`
--
CREATE TABLE `datasets` (
`id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`title` varchar(512) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'title [series x in DOI]',
`setnum` smallint(3) UNSIGNED DEFAULT NULL COMMENT 'index of set in XML file',
`file_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {files}',
`report_id` mediumint(6) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {reports}',
`system_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {systems}',
`reference_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {references}',
`trcidset_id` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'unique id from <trcrefid> and setnum',
`points` smallint(5) UNSIGNED DEFAULT NULL COMMENT 'number of points in dataset',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Sets of property data about a chemical system' ROW_FORMAT=COMPACT;
-- --------------------------------------------------------
--
-- Table structure for table `files`
--
CREATE TABLE `files` (
`id` smallint(5) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`trcid` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'unique id from <trcrefid> in XML',
`abstract` varchar(4096) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'abstract of paper',
`date` varchar(16) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'date of publication',
`year` year(4) DEFAULT NULL COMMENT 'year of publication',
`reference_id` smallint(5) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {references}',
`filename` varchar(128) COLLATE utf8mb4_bin NOT NULL COMMENT 'XML file name',
`points` smallint(5) UNSIGNED DEFAULT NULL COMMENT 'number of points in file',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='TRC Thermoml files';
-- --------------------------------------------------------
--
-- Table structure for table `identifiers`
--
CREATE TABLE `identifiers` (
`id` mediumint(8) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`substance_id` smallint(5) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {substances}',
`type` enum('inchi','inchikey','casrn','smiles','chemspiderId','pubchemId','iupacname','springerId','othername','csmiles','ismiles','wikidataId','dsstoxcmpId','ecnumber','chemblId') COLLATE utf8mb4_bin NOT NULL COMMENT 'type of identifier (enum)',
`value` varchar(1024) COLLATE utf8mb4_bin NOT NULL COMMENT 'identifier value as text',
`source` varchar(8) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'identifier source as text',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='types of information about a substance that is used';
-- --------------------------------------------------------
--
-- Table structure for table `journals`
--
CREATE TABLE `journals` (
`id` tinyint(3) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`name` varchar(256) COLLATE utf8mb4_bin NOT NULL COMMENT 'name of journal',
`coden` varchar(128) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'journal CODEN id',
`issn` varchar(9) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'journal ISSN',
`set` varchar(8) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'code to identify journal file set',
`language` set('Unknown','Afrikaans','Arabic','Chinese','Czech','Danish','Dutch','English','Finnish','French','German','Hungarian','Italian','Japanese','Korean','Norwegian','Polish','Portuguese','Romanian','Russian','Slovak','Spanish','Swedish','Taiwanese','Turkish') COLLATE utf8mb4_bin NOT NULL DEFAULT 'Unknown' COMMENT 'journal language',
`abbrev` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'name abbreviation',
`publisher` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'publisher',
`homepage` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'homepage (URL)',
`doiprefix` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'prefix of doi for journal',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='FAD Journals';
-- --------------------------------------------------------
--
-- Table structure for table `keywords`
--
CREATE TABLE `keywords` (
`id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`report_id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {reports}',
`term` varchar(512) COLLATE utf8mb4_bin NOT NULL COMMENT 'keyword',
`check` tinyint(1) DEFAULT '0' COMMENT 'checked (boolean)',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Table of keywords in XML files';
-- --------------------------------------------------------
--
-- Table structure for table `mixtures`
--
CREATE TABLE `mixtures` (
`id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`system_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {systems}',
`dataset_id` mediumint(6) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {datasets}',
`updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- --------------------------------------------------------
--
-- Table structure for table `nspaces`
--
CREATE TABLE `nspaces` (
`id` smallint(5) UNSIGNED ZEROFILL NOT NULL,
`name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`ns` varchar(8) COLLATE utf8_unicode_ci NOT NULL,
`path` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
`homepage` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Table of ontology namespaces';
-- --------------------------------------------------------
--
-- Table structure for table `ontterms`
--
CREATE TABLE `ontterms` (
`id` smallint(5) UNSIGNED ZEROFILL NOT NULL,
`title` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
`definition` varchar(2048) COLLATE utf8_unicode_ci DEFAULT NULL,
`code` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`url` varchar(512) COLLATE utf8_unicode_ci NOT NULL,
`nspace_id` smallint(5) UNSIGNED ZEROFILL NOT NULL,
`sdsection` enum('metadata','methodology','system','dataset','other') COLLATE utf8_unicode_ci DEFAULT NULL,
`sdsubsection` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Ontological metadata elements';
-- --------------------------------------------------------
--
-- Table structure for table `phases`
--
CREATE TABLE `phases` (
`id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`mixture_id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {mixtures}',
`phasetype_id` tinyint(2) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {phasetypes}',
`orgnum` tinyint(2) UNSIGNED DEFAULT NULL COMMENT '<orgnum> for substance',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Join table for datasets and phases';
-- --------------------------------------------------------
--
-- Table structure for table `phasetypes`
--
CREATE TABLE `phasetypes` (
`id` tinyint(2) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`name` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT 'descriptive name of phase',
`type` enum('solid','liquid','gas','fluid','liquid crystal') COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'phase type (enum)',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='TRC phase options (from schema)';
-- --------------------------------------------------------
--
-- Table structure for table `purificationsteps`
--
CREATE TABLE `purificationsteps` (
`id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`chemical_id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {chemicals}',
`step` tinyint(3) UNSIGNED NOT NULL COMMENT 'step number',
`type` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'step type',
`purity` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'value as text',
`puritysf` tinyint(2) UNSIGNED DEFAULT NULL COMMENT 'purity sig. digits',
`purityunit_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {units}',
`analmeth` varchar(1024) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'analysis method',
`purimeth` varchar(1024) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'purification method',
`updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Table of purification steps for a chemical';
-- --------------------------------------------------------
--
-- Table structure for table `quantities`
--
CREATE TABLE `quantities` (
`id` smallint(5) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`name` varchar(128) COLLATE utf8mb4_bin NOT NULL COMMENT 'name',
`phase` varchar(128) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'phase',
`field` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'XML field',
`label` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT 'label',
`group` enum('Criticals','VaporPBoilingTAzeotropTandP','PhaseTransition','CompositionAtPhaseEquilibrium','ActivityFugacityOsmoticProp','VolumetricProp','HeatCapacityAndDerivedProp','ExcessPartialApparentEnergyProp','TransportProp','RefractionSurfaceTensionSoundSpeed','BioProperties') COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'XML schema group (enum)',
`vartype` enum('eTemperature','ePressure','eComponentComposition','eSolventComposition','eMiscellaneous','eBioVariables','eParticipantAmount') COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'quantity type (enum)',
`symbol` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'symbol',
`definition` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'definition of quantity',
`source` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'source of definition',
`kind` varchar(128) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'kind of quantity',
`quantitykind_id` smallint(5) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {quantitykinds}',
`defunit_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {units}',
`condcnt` mediumint(8) UNSIGNED DEFAULT NULL COMMENT 'count of conditions of this quantity',
`datacnt` mediumint(8) UNSIGNED DEFAULT NULL COMMENT 'count of datums of this quantity',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Table of chemical properties';
-- --------------------------------------------------------
--
-- Table structure for table `quantitykinds`
--
CREATE TABLE `quantitykinds` (
`id` smallint(5) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`name` varchar(128) COLLATE utf8mb4_bin NOT NULL COMMENT 'name',
`altname` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'alternate name',
`symbol` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT 'symbol',
`definition` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'definition of quantity kind',
`source` varchar(128) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'source of definition',
`si_unit` smallint(5) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {units}',
`dim_symbol` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT 'dimensionality symbol',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Table of quantities';
-- --------------------------------------------------------
--
-- Table structure for table `references`
--
CREATE TABLE `references` (
`id` smallint(5) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`journal_id` tinyint(3) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {journals}',
`authors` varchar(2048) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'list of authors as JSON',
`aulist` varchar(2048) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'semicolon separated list of authors',
`year` smallint(4) UNSIGNED DEFAULT NULL COMMENT 'year of publication',
`volume` varchar(12) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'volume',
`issue` varchar(16) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'issue',
`startpage` varchar(16) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'first page',
`endpage` varchar(16) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'last page',
`title` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'title',
`doi` varchar(256) COLLATE utf8mb4_bin NOT NULL COMMENT 'digital object identifer',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='References from Springer Materials PDFs';
-- --------------------------------------------------------
--
-- Table structure for table `reports`
--
CREATE TABLE `reports` (
`id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`title` varchar(512) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'title (autogenerated)',
`description` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'description (autogenerated)',
`file_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {files}',
`reference_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {references}',
`points` smallint(5) UNSIGNED DEFAULT NULL COMMENT 'number of points in report',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Reports of data from the literature' ROW_FORMAT=COMPACT;
-- --------------------------------------------------------
--
-- Table structure for table `sampleprops`
--
CREATE TABLE `sampleprops` (
`id` mediumint(7) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`dataset_id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {datasets}',
`propnum` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'property number in XML',
`orgnum` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'substance number in XML',
`quantity_group` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'group from XML',
`quantity_name` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'name of quantity',
`quantity_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {quantities}',
`unit_id` smallint(5) UNSIGNED ZEROFILL DEFAULT NULL COMMENT 'foreign key {units}',
`method_name` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'method name',
`phase` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'phase of sample',
`presentation` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'how data was presented from XML',
`solventorgnum` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '<orgnum> of solvent',
`uncnum` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'uncertainty number from XML',
`unceval` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'uncertainty evaluation from XML',
`uncconf` varchar(8) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'uncertainty confidence level',
`uncchk` enum('yes','no') COLLATE utf8mb4_bin NOT NULL DEFAULT 'no' COMMENT 'uncertainty check (enum)',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- --------------------------------------------------------
--
-- Table structure for table `substances`
--
CREATE TABLE `substances` (
`id` smallint(5) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`name` varchar(1024) COLLATE utf8mb4_bin NOT NULL COMMENT 'name',
`type` enum('element','compound','not found') COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'type of susbtance (enum)',
`subtype` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'subtype of susbtance (enum)',
`formula` varchar(256) COLLATE utf8mb4_bin NOT NULL COMMENT 'molecular formula',
`mw` varchar(16) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'molecular weight',
`mwsrc` varchar(16) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'source of molecular weight',
`inchikey` varchar(27) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'IUPAC InChIKey',
`files` smallint(4) UNSIGNED DEFAULT NULL COMMENT 'number of files substance occurs in',
`systems` smallint(4) UNSIGNED DEFAULT NULL COMMENT 'number of systems substance is part of',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Table of compounds from Springer materials';
-- --------------------------------------------------------
--
-- Table structure for table `substances_systems`
--
CREATE TABLE `substances_systems` (
`id` mediumint(6) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`substance_id` smallint(5) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {substances}',
`system_id` smallint(5) UNSIGNED ZEROFILL NOT NULL COMMENT 'foreign key {systems}',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- --------------------------------------------------------
--
-- Table structure for table `systems`
--
CREATE TABLE `systems` (
`id` smallint(5) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`name` varchar(300) COLLATE utf8mb4_bin NOT NULL COMMENT 'name (autogenerated)',
`composition` enum('pure substance','binary mixture','ternary mixture','quaternary mixture','quinternary mixture','pure compound') COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'composition, pure or mixture type',
`identifier` varchar(128) COLLATE utf8mb4_bin NOT NULL COMMENT 'unique id from system based on substance ids',
`refcnt` smallint(3) UNSIGNED DEFAULT NULL COMMENT 'number of references system is found in',
`setcnt` smallint(4) UNSIGNED DEFAULT NULL COMMENT 'number of datasets with this system',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- --------------------------------------------------------
--
-- Table structure for table `units`
--
CREATE TABLE `units` (
`id` smallint(5) UNSIGNED ZEROFILL NOT NULL COMMENT 'primary key',
`name` varchar(256) COLLATE utf8mb4_bin NOT NULL COMMENT 'name',
`symbol` varchar(128) COLLATE utf8mb4_bin NOT NULL COMMENT 'symbol',
`type` enum('si','siderived','cgs','imperial','inversesi','other') COLLATE utf8mb4_bin NOT NULL COMMENT 'type of unit (enum)',
`exact` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'is factor exact?',
`factor` float NOT NULL DEFAULT '1' COMMENT 'conversion factor to SI',
`si_equivalent` varchar(128) COLLATE utf8mb4_bin NOT NULL COMMENT 'equivalent in the SI',
`qudt` varchar(128) COLLATE utf8mb4_bin NOT NULL COMMENT 'QUDT unit encoding',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Table of scientific units';
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` tinyint(3) UNSIGNED ZEROFILL NOT NULL,
`username` varchar(16) COLLATE utf8mb4_bin NOT NULL,
`password` varchar(1024) COLLATE utf8mb4_bin NOT NULL,
`firstname` varchar(16) COLLATE utf8mb4_bin NOT NULL,
`lastname` varchar(16) COLLATE utf8mb4_bin NOT NULL,
`email` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL,
`type` enum('regular','admin','superadmin') COLLATE utf8mb4_bin NOT NULL DEFAULT 'regular',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Table of users';
--
-- Indexes for dumped tables
--
--
-- Indexes for table `chemicals`
--
ALTER TABLE `chemicals`
ADD PRIMARY KEY (`id`),
ADD KEY `substances` (`substance_id`) USING BTREE,
ADD KEY `files` (`file_id`) USING BTREE;
--
-- Indexes for table `chemicals_datasets`
--
ALTER TABLE `chemicals_datasets`
ADD PRIMARY KEY (`id`),
ADD KEY `chemicals` (`chemical_id`) USING BTREE,
ADD KEY `datasets` (`dataset_id`) USING BTREE;
--
-- Indexes for table `components`
--
ALTER TABLE `components`
ADD PRIMARY KEY (`id`),
ADD KEY `chemicals` (`chemical_id`) USING BTREE,
ADD KEY `mixtures` (`mixture_id`) USING BTREE;
--
-- Indexes for table `conditions`
--
ALTER TABLE `conditions`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_conds_comps` (`component_id`),
ADD KEY `fk_conds_phases` (`phase_id`),
ADD KEY `fk_conds_points` (`datapoint_id`),
ADD KEY `fk_conds_quants` (`quantity_id`),
ADD KEY `fk_conds_series` (`dataseries_id`),
ADD KEY `fk_conds_sets` (`dataset_id`),
ADD KEY `fk_conds_syss` (`system_id`),
ADD KEY `fk_conds_units` (`unit_id`);
--
-- Indexes for table `crosswalks`
--
ALTER TABLE `crosswalks`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `data`
--
ALTER TABLE `data`
ADD PRIMARY KEY (`id`),
ADD KEY `components` (`component_id`) USING BTREE,
ADD KEY `quantities` (`quantity_id`) USING BTREE,
ADD KEY `dataseries` (`dataseries_id`) USING BTREE,
ADD KEY `phases` (`phase_id`) USING BTREE,
ADD KEY `datasets` (`dataset_id`) USING BTREE,
ADD KEY `sampleprops` (`sampleprop_id`) USING BTREE,
ADD KEY `units` (`unit_id`) USING BTREE,
ADD KEY `datapoints` (`datapoint_id`) USING BTREE;
--
-- Indexes for table `datapoints`
--
ALTER TABLE `datapoints`
ADD PRIMARY KEY (`id`),
ADD KEY `dataseries` (`dataseries_id`) USING BTREE,
ADD KEY `datasets` (`dataset_id`) USING BTREE;
--
-- Indexes for table `dataseries`
--
ALTER TABLE `dataseries`
ADD PRIMARY KEY (`id`),
ADD KEY `datasets` (`dataset_id`) USING BTREE;
--
-- Indexes for table `datasets`
--
ALTER TABLE `datasets`
ADD PRIMARY KEY (`id`),
ADD KEY `files` (`file_id`) USING BTREE,
ADD KEY `reports` (`report_id`) USING BTREE,
ADD KEY `references` (`reference_id`) USING BTREE,
ADD KEY `systems` (`system_id`) USING BTREE;
--
-- Indexes for table `files`
--
ALTER TABLE `files`
ADD PRIMARY KEY (`id`),
ADD KEY `year` (`year`),
ADD KEY `references` (`reference_id`) USING BTREE;
--
-- Indexes for table `identifiers`
--
ALTER TABLE `identifiers`
ADD PRIMARY KEY (`id`),
ADD KEY `type` (`type`),
ADD KEY `substances` (`substance_id`) USING BTREE;
--
-- Indexes for table `journals`
--
ALTER TABLE `journals`
ADD UNIQUE KEY `ID` (`id`);
--
-- Indexes for table `keywords`
--
ALTER TABLE `keywords`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_keys_reports` (`report_id`);
--
-- Indexes for table `mixtures`
--
ALTER TABLE `mixtures`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `sys-set` (`system_id`,`dataset_id`),
ADD KEY `datasets` (`dataset_id`) USING BTREE;
--
-- Indexes for table `nspaces`
--
ALTER TABLE `nspaces`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `path` (`path`);
--
-- Indexes for table `ontterms`
--
ALTER TABLE `ontterms`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `phases`
--
ALTER TABLE `phases`
ADD PRIMARY KEY (`id`),
ADD KEY `mixes` (`mixture_id`) USING BTREE,
ADD KEY `ptypes` (`phasetype_id`) USING BTREE;
--
-- Indexes for table `phasetypes`
--
ALTER TABLE `phasetypes`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `purificationsteps`
--
ALTER TABLE `purificationsteps`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_steps_chems` (`chemical_id`),
ADD KEY `fk_steps_units` (`purityunit_id`);
--
-- Indexes for table `quantities`
--
ALTER TABLE `quantities`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_quants_qkinds` (`quantitykind_id`),
ADD KEY `fk_quants_units` (`defunit_id`);
--
-- Indexes for table `quantitykinds`
--
ALTER TABLE `quantitykinds`
ADD PRIMARY KEY (`id`),
ADD KEY `units` (`si_unit`) USING BTREE;
--
-- Indexes for table `references`
--
ALTER TABLE `references`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_refs_jrnls` (`journal_id`);
--
-- Indexes for table `reports`
--
ALTER TABLE `reports`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_refs_reports` (`reference_id`),
ADD KEY `fk_files_reports` (`file_id`);
--
-- Indexes for table `sampleprops`
--
ALTER TABLE `sampleprops`
ADD PRIMARY KEY (`id`),
ADD KEY `dataset_id` (`dataset_id`),
ADD KEY `units` (`unit_id`) USING BTREE,
ADD KEY `fk_sprops_quants` (`quantity_id`);
--
-- Indexes for table `substances`
--
ALTER TABLE `substances`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `substances_systems`
--
ALTER TABLE `substances_systems`
ADD PRIMARY KEY (`id`),
ADD KEY `systems` (`system_id`) USING BTREE,
ADD KEY `substances` (`substance_id`) USING BTREE;
--
-- Indexes for table `systems`
--
ALTER TABLE `systems`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `identifier` (`identifier`),
ADD KEY `name` (`name`),
ADD KEY `composition` (`composition`) USING BTREE;
--
-- Indexes for table `units`
--
ALTER TABLE `units`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `chemicals`
--
ALTER TABLE `chemicals`
MODIFY `id` mediumint(6) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `chemicals_datasets`
--
ALTER TABLE `chemicals_datasets`
MODIFY `id` mediumint(8) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `components`
--
ALTER TABLE `components`
MODIFY `id` mediumint(6) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'foreign key';
--
-- AUTO_INCREMENT for table `conditions`
--
ALTER TABLE `conditions`
MODIFY `id` mediumint(7) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `crosswalks`
--
ALTER TABLE `crosswalks`
MODIFY `id` mediumint(7) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `data`
--
ALTER TABLE `data`
MODIFY `id` mediumint(8) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `datapoints`
--
ALTER TABLE `datapoints`
MODIFY `id` mediumint(7) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `dataseries`
--
ALTER TABLE `dataseries`
MODIFY `id` mediumint(6) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `datasets`
--
ALTER TABLE `datasets`
MODIFY `id` mediumint(6) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `files`
--
ALTER TABLE `files`
MODIFY `id` smallint(5) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `identifiers`
--
ALTER TABLE `identifiers`
MODIFY `id` mediumint(8) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `journals`
--
ALTER TABLE `journals`
MODIFY `id` tinyint(3) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `keywords`
--
ALTER TABLE `keywords`
MODIFY `id` mediumint(6) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `mixtures`
--
ALTER TABLE `mixtures`
MODIFY `id` mediumint(6) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `nspaces`
--
ALTER TABLE `nspaces`
MODIFY `id` smallint(5) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `ontterms`
--
ALTER TABLE `ontterms`
MODIFY `id` smallint(5) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `phases`
--
ALTER TABLE `phases`
MODIFY `id` mediumint(6) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `phasetypes`
--
ALTER TABLE `phasetypes`
MODIFY `id` tinyint(2) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `purificationsteps`
--
ALTER TABLE `purificationsteps`
MODIFY `id` mediumint(6) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `quantities`
--
ALTER TABLE `quantities`
MODIFY `id` smallint(5) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `quantitykinds`
--
ALTER TABLE `quantitykinds`
MODIFY `id` smallint(5) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `references`
--
ALTER TABLE `references`
MODIFY `id` smallint(5) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `reports`
--
ALTER TABLE `reports`
MODIFY `id` mediumint(6) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `sampleprops`
--
ALTER TABLE `sampleprops`
MODIFY `id` mediumint(7) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `substances`
--
ALTER TABLE `substances`
MODIFY `id` smallint(5) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `substances_systems`
--
ALTER TABLE `substances_systems`
MODIFY `id` mediumint(6) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `systems`
--
ALTER TABLE `systems`
MODIFY `id` smallint(5) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `units`
--
ALTER TABLE `units`
MODIFY `id` smallint(5) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'primary key';
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` tinyint(3) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `chemicals`
--
ALTER TABLE `chemicals`
ADD CONSTRAINT `fk_chems_files` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`),
ADD CONSTRAINT `fk_chems_subs` FOREIGN KEY (`substance_id`) REFERENCES `substances` (`id`);
--
-- Constraints for table `chemicals_datasets`
--
ALTER TABLE `chemicals_datasets`
ADD CONSTRAINT `fk_chemsets_chems` FOREIGN KEY (`chemical_id`) REFERENCES `chemicals` (`id`),
ADD CONSTRAINT `fk_chemsets_sets` FOREIGN KEY (`dataset_id`) REFERENCES `datasets` (`id`);
--
-- Constraints for table `components`
--
ALTER TABLE `components`
ADD CONSTRAINT `fk_comps_chems` FOREIGN KEY (`chemical_id`) REFERENCES `chemicals` (`id`),
ADD CONSTRAINT `fk_comps_mixes` FOREIGN KEY (`mixture_id`) REFERENCES `mixtures` (`id`);
--
-- Constraints for table `conditions`
--
ALTER TABLE `conditions`
ADD CONSTRAINT `fk_conds_comps` FOREIGN KEY (`component_id`) REFERENCES `components` (`id`),
ADD CONSTRAINT `fk_conds_phases` FOREIGN KEY (`phase_id`) REFERENCES `phases` (`id`),
ADD CONSTRAINT `fk_conds_points` FOREIGN KEY (`datapoint_id`) REFERENCES `datapoints` (`id`),
ADD CONSTRAINT `fk_conds_quants` FOREIGN KEY (`quantity_id`) REFERENCES `quantities` (`id`),
ADD CONSTRAINT `fk_conds_series` FOREIGN KEY (`dataseries_id`) REFERENCES `dataseries` (`id`),
ADD CONSTRAINT `fk_conds_sets` FOREIGN KEY (`dataset_id`) REFERENCES `datasets` (`id`),
ADD CONSTRAINT `fk_conds_syss` FOREIGN KEY (`system_id`) REFERENCES `systems` (`id`),
ADD CONSTRAINT `fk_conds_units` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`);
--
-- Constraints for table `data`
--
ALTER TABLE `data`
ADD CONSTRAINT `fk_data_comps` FOREIGN KEY (`component_id`) REFERENCES `components` (`id`),
ADD CONSTRAINT `fk_data_phases` FOREIGN KEY (`phase_id`) REFERENCES `phases` (`id`),
ADD CONSTRAINT `fk_data_points` FOREIGN KEY (`datapoint_id`) REFERENCES `datapoints` (`id`),
ADD CONSTRAINT `fk_data_quants` FOREIGN KEY (`quantity_id`) REFERENCES `quantities` (`id`),
ADD CONSTRAINT `fk_data_sers` FOREIGN KEY (`dataseries_id`) REFERENCES `dataseries` (`id`),
ADD CONSTRAINT `fk_data_sets` FOREIGN KEY (`dataset_id`) REFERENCES `datasets` (`id`),
ADD CONSTRAINT `fk_data_sprops` FOREIGN KEY (`sampleprop_id`) REFERENCES `sampleprops` (`id`),
ADD CONSTRAINT `fk_data_units` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`);
--
-- Constraints for table `datapoints`
--
ALTER TABLE `datapoints`