Project

General

Profile

« Previous | Next » 

Revision 8632

schemas/VegCore/VegCore.ERD.mwb: saved settings for publishing schema to vegbiendev phpMyAdmin (vegbiendev.nceas.ucsb.edu/phpmyadmin/index.php?db=VegCore). this adds `DROP TABLE IF EXISTS` before each CREATE TABLE statement, renames the default DB to VegCore, and adds a USE statement to select the VegCore DB.

View differences:

schemas/VegCore/VegCore.my.sql
2 2
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
3 3
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
4 4

  
5
CREATE SCHEMA IF NOT EXISTS `VegCore` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
6
USE `VegCore` ;
5 7

  
6 8
-- -----------------------------------------------------
7 9
-- Table `source`
8 10
-- -----------------------------------------------------
11
DROP TABLE IF EXISTS `source` ;
12

  
9 13
CREATE  TABLE IF NOT EXISTS `source` (
10 14
  `id` VARBINARY(767) NOT NULL ,
11 15
  `parent` VARBINARY(767) NOT NULL ,
......
41 45
-- -----------------------------------------------------
42 46
-- Table `record`
43 47
-- -----------------------------------------------------
48
DROP TABLE IF EXISTS `record` ;
49

  
44 50
CREATE  TABLE IF NOT EXISTS `record` (
45 51
  `id` VARBINARY(767) NOT NULL ,
46 52
  `source` VARBINARY(767) NOT NULL ,
......
61 67
-- -----------------------------------------------------
62 68
-- Table `party`
63 69
-- -----------------------------------------------------
70
DROP TABLE IF EXISTS `party` ;
71

  
64 72
CREATE  TABLE IF NOT EXISTS `party` (
65 73
  `id` VARBINARY(767) NOT NULL ,
66 74
  `info` SET('hstore') NULL ,
......
78 86
-- -----------------------------------------------------
79 87
-- Table `relationship`
80 88
-- -----------------------------------------------------
89
DROP TABLE IF EXISTS `relationship` ;
90

  
81 91
CREATE  TABLE IF NOT EXISTS `relationship` (
82 92
  `id` VARBINARY(767) NOT NULL ,
83 93
  `record` VARBINARY(767) NOT NULL ,
......
109 119
-- -----------------------------------------------------
110 120
-- Table `collection`
111 121
-- -----------------------------------------------------
122
DROP TABLE IF EXISTS `collection` ;
123

  
112 124
CREATE  TABLE IF NOT EXISTS `collection` (
113 125
  `id` VARBINARY(767) NOT NULL ,
114 126
  PRIMARY KEY (`id`) ,
......
125 137
-- -----------------------------------------------------
126 138
-- Table `taxon_assertion`
127 139
-- -----------------------------------------------------
140
DROP TABLE IF EXISTS `taxon_assertion` ;
141

  
128 142
CREATE  TABLE IF NOT EXISTS `taxon_assertion` (
129 143
  `id` VARBINARY(767) NOT NULL ,
130 144
  `string` VARBINARY(767) NOT NULL ,
......
157 171
-- -----------------------------------------------------
158 172
-- Table `parsed_taxon_assertion`
159 173
-- -----------------------------------------------------
174
DROP TABLE IF EXISTS `parsed_taxon_assertion` ;
175

  
160 176
CREATE  TABLE IF NOT EXISTS `parsed_taxon_assertion` (
161 177
  `id` VARBINARY(767) NOT NULL ,
162 178
  `matched_taxon` VARBINARY(767) NULL DEFAULT NULL ,
......
182 198
-- -----------------------------------------------------
183 199
-- Table `taxon_string`
184 200
-- -----------------------------------------------------
201
DROP TABLE IF EXISTS `taxon_string` ;
202

  
185 203
CREATE  TABLE IF NOT EXISTS `taxon_string` (
186 204
  `string` VARBINARY(767) NOT NULL ,
187 205
  `parsed_taxon_assertion` VARBINARY(767) NULL DEFAULT NULL ,
......
200 218
-- -----------------------------------------------------
201 219
-- Table `taxon_name`
202 220
-- -----------------------------------------------------
221
DROP TABLE IF EXISTS `taxon_name` ;
222

  
203 223
CREATE  TABLE IF NOT EXISTS `taxon_name` (
204 224
  `id` VARBINARY(767) NOT NULL ,
205 225
  `unique_name` VARBINARY(767) NOT NULL ,
......
228 248
-- -----------------------------------------------------
229 249
-- Table `coordinates`
230 250
-- -----------------------------------------------------
251
DROP TABLE IF EXISTS `coordinates` ;
252

  
231 253
CREATE  TABLE IF NOT EXISTS `coordinates` (
232 254
  `id` VARBINARY(767) NOT NULL ,
233 255
  `latitude_deg` VARBINARY(767) NULL DEFAULT NULL ,
......
241 263
-- -----------------------------------------------------
242 264
-- Table `place_path`
243 265
-- -----------------------------------------------------
266
DROP TABLE IF EXISTS `place_path` ;
267

  
244 268
CREATE  TABLE IF NOT EXISTS `place_path` (
245 269
  `id` VARBINARY(767) NOT NULL ,
246 270
  `continent` VARBINARY(767) NULL DEFAULT NULL ,
......
258 282
-- -----------------------------------------------------
259 283
-- Table `place`
260 284
-- -----------------------------------------------------
285
DROP TABLE IF EXISTS `place` ;
286

  
261 287
CREATE  TABLE IF NOT EXISTS `place` (
262 288
  `id` VARBINARY(767) NOT NULL ,
263 289
  `parent` VARBINARY(767) NOT NULL ,
......
296 322
-- -----------------------------------------------------
297 323
-- Table `method`
298 324
-- -----------------------------------------------------
325
DROP TABLE IF EXISTS `method` ;
326

  
299 327
CREATE  TABLE IF NOT EXISTS `method` (
300 328
  `id` VARBINARY(767) NOT NULL ,
301 329
  `info` SET('hstore') NULL ,
......
313 341
-- -----------------------------------------------------
314 342
-- Table `event`
315 343
-- -----------------------------------------------------
344
DROP TABLE IF EXISTS `event` ;
345

  
316 346
CREATE  TABLE IF NOT EXISTS `event` (
317 347
  `id` VARBINARY(767) NOT NULL ,
318 348
  `parent` VARBINARY(767) NOT NULL ,
......
352 382
-- -----------------------------------------------------
353 383
-- Table `organization`
354 384
-- -----------------------------------------------------
385
DROP TABLE IF EXISTS `organization` ;
386

  
355 387
CREATE  TABLE IF NOT EXISTS `organization` (
356 388
  `id` VARBINARY(767) NOT NULL ,
357 389
  `info` SET('hstore') NULL ,
......
369 401
-- -----------------------------------------------------
370 402
-- Table `specimen`
371 403
-- -----------------------------------------------------
404
DROP TABLE IF EXISTS `specimen` ;
405

  
372 406
CREATE  TABLE IF NOT EXISTS `specimen` (
373 407
  `id` VARBINARY(767) NOT NULL ,
374 408
  `collection` VARBINARY(767) NULL DEFAULT NULL ,
......
415 449
-- -----------------------------------------------------
416 450
-- Table `taxon_observation`
417 451
-- -----------------------------------------------------
452
DROP TABLE IF EXISTS `taxon_observation` ;
453

  
418 454
CREATE  TABLE IF NOT EXISTS `taxon_observation` (
419 455
  `id` VARBINARY(767) NOT NULL ,
420 456
  `taxon_occurrence` VARBINARY(767) NOT NULL ,
......
448 484
-- -----------------------------------------------------
449 485
-- Table `taxon_determination`
450 486
-- -----------------------------------------------------
487
DROP TABLE IF EXISTS `taxon_determination` ;
488

  
451 489
CREATE  TABLE IF NOT EXISTS `taxon_determination` (
452 490
  `id` VARBINARY(767) NOT NULL ,
453 491
  `taxon_assertion` VARBINARY(767) NOT NULL ,
......
480 518
-- -----------------------------------------------------
481 519
-- Table `taxon_occurrence`
482 520
-- -----------------------------------------------------
521
DROP TABLE IF EXISTS `taxon_occurrence` ;
522

  
483 523
CREATE  TABLE IF NOT EXISTS `taxon_occurrence` (
484 524
  `id` VARBINARY(767) NOT NULL ,
485 525
  `collector` VARBINARY(767) NULL DEFAULT NULL ,
......
525 565
-- -----------------------------------------------------
526 566
-- Table `individual`
527 567
-- -----------------------------------------------------
568
DROP TABLE IF EXISTS `individual` ;
569

  
528 570
CREATE  TABLE IF NOT EXISTS `individual` (
529 571
  `id` VARBINARY(767) NOT NULL ,
530 572
  `tag` VARBINARY(767) NULL DEFAULT NULL ,
......
543 585
-- -----------------------------------------------------
544 586
-- Table `aggregate_observation`
545 587
-- -----------------------------------------------------
588
DROP TABLE IF EXISTS `aggregate_observation` ;
589

  
546 590
CREATE  TABLE IF NOT EXISTS `aggregate_observation` (
547 591
  `id` VARBINARY(767) NOT NULL ,
548 592
  `taxon` VARBINARY(767) NOT NULL ,
......
566 610
-- -----------------------------------------------------
567 611
-- Table `taxon_presence`
568 612
-- -----------------------------------------------------
613
DROP TABLE IF EXISTS `taxon_presence` ;
614

  
569 615
CREATE  TABLE IF NOT EXISTS `taxon_presence` (
570 616
  `id` VARBINARY(767) NOT NULL ,
571 617
  `taxon` VARBINARY(767) NOT NULL ,
......
589 635
-- -----------------------------------------------------
590 636
-- Table `taxon_concept`
591 637
-- -----------------------------------------------------
638
DROP TABLE IF EXISTS `taxon_concept` ;
639

  
592 640
CREATE  TABLE IF NOT EXISTS `taxon_concept` (
593 641
  `id` VARBINARY(767) NOT NULL ,
594 642
  `according_to` VARBINARY(767) NOT NULL ,
......
627 675
-- -----------------------------------------------------
628 676
-- Table `community`
629 677
-- -----------------------------------------------------
678
DROP TABLE IF EXISTS `community` ;
679

  
630 680
CREATE  TABLE IF NOT EXISTS `community` (
631 681
  `id` VARBINARY(767) NOT NULL ,
632 682
  `name` VARBINARY(767) NOT NULL ,
......
645 695
-- -----------------------------------------------------
646 696
-- Table `geological_context`
647 697
-- -----------------------------------------------------
698
DROP TABLE IF EXISTS `geological_context` ;
699

  
648 700
CREATE  TABLE IF NOT EXISTS `geological_context` (
649 701
  `id` VARBINARY(767) NOT NULL ,
650 702
  `name` VARBINARY(767) NOT NULL ,
......
663 715
-- -----------------------------------------------------
664 716
-- Table `place_observation`
665 717
-- -----------------------------------------------------
718
DROP TABLE IF EXISTS `place_observation` ;
719

  
666 720
CREATE  TABLE IF NOT EXISTS `place_observation` (
667 721
  `id` VARBINARY(767) NOT NULL ,
668 722
  `place` VARBINARY(767) NOT NULL ,
......
705 759
-- -----------------------------------------------------
706 760
-- Table `soil_observation`
707 761
-- -----------------------------------------------------
762
DROP TABLE IF EXISTS `soil_observation` ;
763

  
708 764
CREATE  TABLE IF NOT EXISTS `soil_observation` (
709 765
  `id` VARBINARY(767) NOT NULL ,
710 766
  `observations` SET('hstore') NULL ,
......
722 778
-- -----------------------------------------------------
723 779
-- Table `plot`
724 780
-- -----------------------------------------------------
781
DROP TABLE IF EXISTS `plot` ;
782

  
725 783
CREATE  TABLE IF NOT EXISTS `plot` (
726 784
  `id` VARBINARY(767) NOT NULL ,
727 785
  `name` VARBINARY(767) NULL DEFAULT NULL ,
......
741 799
-- -----------------------------------------------------
742 800
-- Table `subplot`
743 801
-- -----------------------------------------------------
802
DROP TABLE IF EXISTS `subplot` ;
803

  
744 804
CREATE  TABLE IF NOT EXISTS `subplot` (
745 805
  `id` VARBINARY(767) NOT NULL ,
746 806
  `x_m` DOUBLE NULL ,
......
759 819
-- -----------------------------------------------------
760 820
-- Table `validatable_place`
761 821
-- -----------------------------------------------------
822
DROP TABLE IF EXISTS `validatable_place` ;
823

  
762 824
CREATE  TABLE IF NOT EXISTS `validatable_place` (
763 825
  `id` VARBINARY(767) NOT NULL ,
764 826
  `coordinates` VARBINARY(767) NOT NULL ,
......
785 847
-- -----------------------------------------------------
786 848
-- Table `individual_observation`
787 849
-- -----------------------------------------------------
850
DROP TABLE IF EXISTS `individual_observation` ;
851

  
788 852
CREATE  TABLE IF NOT EXISTS `individual_observation` (
789 853
  `id` VARBINARY(767) NOT NULL ,
790 854
  `individual` VARBINARY(767) NOT NULL ,
......
809 873
-- -----------------------------------------------------
810 874
-- Table `stem`
811 875
-- -----------------------------------------------------
876
DROP TABLE IF EXISTS `stem` ;
877

  
812 878
CREATE  TABLE IF NOT EXISTS `stem` (
813 879
  `id` VARBINARY(767) NOT NULL ,
814 880
  `individual` VARBINARY(767) NOT NULL ,
......
832 898
-- -----------------------------------------------------
833 899
-- Table `stem_observation`
834 900
-- -----------------------------------------------------
901
DROP TABLE IF EXISTS `stem_observation` ;
902

  
835 903
CREATE  TABLE IF NOT EXISTS `stem_observation` (
836 904
  `id` VARBINARY(767) NOT NULL ,
837 905
  `individual_observation` VARBINARY(767) NOT NULL ,
......
864 932
-- -----------------------------------------------------
865 933
-- Table `project`
866 934
-- -----------------------------------------------------
935
DROP TABLE IF EXISTS `project` ;
936

  
867 937
CREATE  TABLE IF NOT EXISTS `project` (
868 938
  `id` VARBINARY(767) NOT NULL ,
869 939
  `name` VARBINARY(767) NOT NULL ,
......
882 952
-- -----------------------------------------------------
883 953
-- Table `referenced_class`
884 954
-- -----------------------------------------------------
955
DROP TABLE IF EXISTS `referenced_class` ;
956

  
885 957
CREATE  TABLE IF NOT EXISTS `referenced_class` (
886 958
  `id` VARBINARY(767) NOT NULL ,
887 959
  PRIMARY KEY (`id`) ,
......
898 970
-- -----------------------------------------------------
899 971
-- Table `base_class`
900 972
-- -----------------------------------------------------
973
DROP TABLE IF EXISTS `base_class` ;
974

  
901 975
CREATE  TABLE IF NOT EXISTS `base_class` (
902 976
  `id` VARBINARY(767) NOT NULL ,
903 977
  `referenced_class` VARBINARY(767) NOT NULL ,
......
921 995
-- -----------------------------------------------------
922 996
-- Table `derived_class`
923 997
-- -----------------------------------------------------
998
DROP TABLE IF EXISTS `derived_class` ;
999

  
924 1000
CREATE  TABLE IF NOT EXISTS `derived_class` (
925 1001
  `id` VARBINARY(767) NOT NULL ,
926 1002
  PRIMARY KEY (`id`) ,
......
937 1013
-- -----------------------------------------------------
938 1014
-- Table `stratum`
939 1015
-- -----------------------------------------------------
1016
DROP TABLE IF EXISTS `stratum` ;
1017

  
940 1018
CREATE  TABLE IF NOT EXISTS `stratum` (
941 1019
  `id` VARBINARY(767) NOT NULL ,
942 1020
  `name` VARBINARY(767) NOT NULL ,
......
955 1033
-- -----------------------------------------------------
956 1034
-- Table `1. verbatim`
957 1035
-- -----------------------------------------------------
1036
DROP TABLE IF EXISTS `1. verbatim` ;
1037

  
958 1038
CREATE  TABLE IF NOT EXISTS `1. verbatim` (
959 1039
  `id` VARBINARY(767) NOT NULL ,
960 1040
  PRIMARY KEY (`id`) )
......
966 1046
-- -----------------------------------------------------
967 1047
-- Table `2. concatenated`
968 1048
-- -----------------------------------------------------
1049
DROP TABLE IF EXISTS `2. concatenated` ;
1050

  
969 1051
CREATE  TABLE IF NOT EXISTS `2. concatenated` (
970 1052
  `id` VARBINARY(767) NOT NULL ,
971 1053
  PRIMARY KEY (`id`) )
......
977 1059
-- -----------------------------------------------------
978 1060
-- Table `3. parsed`
979 1061
-- -----------------------------------------------------
1062
DROP TABLE IF EXISTS `3. parsed` ;
1063

  
980 1064
CREATE  TABLE IF NOT EXISTS `3. parsed` (
981 1065
  `id` VARBINARY(767) NOT NULL ,
982 1066
  PRIMARY KEY (`id`) )
......
988 1072
-- -----------------------------------------------------
989 1073
-- Table `plot_stratum`
990 1074
-- -----------------------------------------------------
1075
DROP TABLE IF EXISTS `plot_stratum` ;
1076

  
991 1077
CREATE  TABLE IF NOT EXISTS `plot_stratum` (
992 1078
  `id` VARBINARY(767) NOT NULL ,
993 1079
  `stratum` VARBINARY(767) NOT NULL ,
......
1011 1097
-- -----------------------------------------------------
1012 1098
-- Table `4. matched`
1013 1099
-- -----------------------------------------------------
1100
DROP TABLE IF EXISTS `4. matched` ;
1101

  
1014 1102
CREATE  TABLE IF NOT EXISTS `4. matched` (
1015 1103
  `id` VARBINARY(767) NOT NULL ,
1016 1104
  PRIMARY KEY (`id`) )
......
1022 1110
-- -----------------------------------------------------
1023 1111
-- Table `5. accepted`
1024 1112
-- -----------------------------------------------------
1113
DROP TABLE IF EXISTS `5. accepted` ;
1114

  
1025 1115
CREATE  TABLE IF NOT EXISTS `5. accepted` (
1026 1116
  `id` VARBINARY(767) NOT NULL ,
1027 1117
  PRIMARY KEY (`id`) )
......
1033 1123
-- -----------------------------------------------------
1034 1124
-- Table `TNRS taxonomic scrubbing steps`
1035 1125
-- -----------------------------------------------------
1126
DROP TABLE IF EXISTS `TNRS taxonomic scrubbing steps` ;
1127

  
1036 1128
CREATE  TABLE IF NOT EXISTS `TNRS taxonomic scrubbing steps` (
1037 1129
  `id` VARBINARY(767) NOT NULL ,
1038 1130
  PRIMARY KEY (`id`) )
......
1044 1136
-- -----------------------------------------------------
1045 1137
-- Table `geovalidation`
1046 1138
-- -----------------------------------------------------
1139
DROP TABLE IF EXISTS `geovalidation` ;
1140

  
1047 1141
CREATE  TABLE IF NOT EXISTS `geovalidation` (
1048 1142
  `id` VARBINARY(767) NOT NULL ,
1049 1143
  `geovalid` TINYINT(1) NOT NULL ,
......
1063 1157
-- -----------------------------------------------------
1064 1158
-- Table `taxon_path`
1065 1159
-- -----------------------------------------------------
1160
DROP TABLE IF EXISTS `taxon_path` ;
1161

  
1066 1162
CREATE  TABLE IF NOT EXISTS `taxon_path` (
1067 1163
  `id` VARBINARY(767) NOT NULL ,
1068 1164
  `family` VARBINARY(767) NULL DEFAULT NULL ,
......
1083 1179
-- -----------------------------------------------------
1084 1180
-- Table `specimen_observation`
1085 1181
-- -----------------------------------------------------
1182
DROP TABLE IF EXISTS `specimen_observation` ;
1183

  
1086 1184
CREATE  TABLE IF NOT EXISTS `specimen_observation` (
1087 1185
  `id` VARBINARY(767) NOT NULL ,
1088 1186
  `specimen` VARBINARY(767) NOT NULL ,
......
1106 1204
-- -----------------------------------------------------
1107 1205
-- Table `event_participant`
1108 1206
-- -----------------------------------------------------
1207
DROP TABLE IF EXISTS `event_participant` ;
1208

  
1109 1209
CREATE  TABLE IF NOT EXISTS `event_participant` (
1110 1210
  `event` VARBINARY(767) NOT NULL ,
1111 1211
  `party` VARBINARY(767) NOT NULL ,
......
1131 1231
-- -----------------------------------------------------
1132 1232
-- Table `specimen_holder_institution`
1133 1233
-- -----------------------------------------------------
1234
DROP TABLE IF EXISTS `specimen_holder_institution` ;
1235

  
1134 1236
CREATE  TABLE IF NOT EXISTS `specimen_holder_institution` (
1135 1237
  `specimen` VARBINARY(767) NOT NULL ,
1136 1238
  `institution` VARBINARY(767) NOT NULL ,
......
1152 1254
DEFAULT CHARACTER SET = utf8
1153 1255
COLLATE = utf8_bin;
1154 1256

  
1257
USE `VegCore` ;
1155 1258

  
1156 1259

  
1157 1260
SET SQL_MODE=@OLD_SQL_MODE;

Also available in: Unified diff