Project

General

Profile

« Previous | Next » 

Revision 8932

bin/my2pg: translate varbinary to bytea

View differences:

schemas/VegCore/VegCore.pg.sql
18 18

  
19 19
DROP TABLE IF EXISTS "aggregate_observation";
20 20
CREATE TABLE "aggregate_observation" (
21
  "id" varbinary(767) NOT NULL,
22
  "taxon_concept" varbinary(767) NOT NULL,
21
  "id" bytea NOT NULL,
22
  "taxon_concept" bytea NOT NULL,
23 23
  "traits" set('hstore') DEFAULT NULL,
24 24
  PRIMARY KEY ("id"),
25 25
  /*KEY "fk_aggregate_observation_taxon_name1_idx" ("taxon_concept")*/CHECK (true),
......
40 40

  
41 41
DROP TABLE IF EXISTS "base_class";
42 42
CREATE TABLE "base_class" (
43
  "id" varbinary(767) NOT NULL,
44
  "referenced_class" varbinary(767) NOT NULL,
43
  "id" bytea NOT NULL,
44
  "referenced_class" bytea NOT NULL,
45 45
  PRIMARY KEY ("id"),
46 46
  /*KEY "fk_base_class_referenced_class1_idx" ("referenced_class")*/CHECK (true),
47 47
  /*CONSTRAINT "fk_base_class_referenced_class1" FOREIGN KEY ("referenced_class") REFERENCES "referenced_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
......
61 61

  
62 62
DROP TABLE IF EXISTS "collection";
63 63
CREATE TABLE "collection" (
64
  "id" varbinary(767) NOT NULL,
65
  "institution" varbinary(767) NOT NULL,
66
  "name" varbinary(767) NOT NULL,
64
  "id" bytea NOT NULL,
65
  "institution" bytea NOT NULL,
66
  "name" bytea NOT NULL,
67 67
  PRIMARY KEY ("id"),
68 68
  /*CONSTRAINT "collection_unique" */UNIQUE ("institution","name"),
69 69
  /*KEY "fk_collection_organization1_idx" ("institution")*/CHECK (true),
......
85 85

  
86 86
DROP TABLE IF EXISTS "community";
87 87
CREATE TABLE "community" (
88
  "id" varbinary(767) NOT NULL,
89
  "name" varbinary(767) NOT NULL,
88
  "id" bytea NOT NULL,
89
  "name" bytea NOT NULL,
90 90
  "info" set('hstore') DEFAULT NULL,
91 91
  PRIMARY KEY ("id"),
92 92
  /*CONSTRAINT "fk_community_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
......
105 105

  
106 106
DROP TABLE IF EXISTS "coordinates";
107 107
CREATE TABLE "coordinates" (
108
  "id" varbinary(767) NOT NULL,
109
  "latitude_deg" varbinary(767) DEFAULT NULL,
110
  "longitude_deg" varbinary(767) DEFAULT NULL,
108
  "id" bytea NOT NULL,
109
  "latitude_deg" bytea DEFAULT NULL,
110
  "longitude_deg" bytea DEFAULT NULL,
111 111
  PRIMARY KEY ("id")
112 112
);
113 113

  
......
124 124

  
125 125
DROP TABLE IF EXISTS "derived_class";
126 126
CREATE TABLE "derived_class" (
127
  "id" varbinary(767) NOT NULL,
127
  "id" bytea NOT NULL,
128 128
  PRIMARY KEY ("id"),
129 129
  /*CONSTRAINT "fk_derived_class_base_class1" FOREIGN KEY ("id") REFERENCES "base_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
130 130
);
......
142 142

  
143 143
DROP TABLE IF EXISTS "event";
144 144
CREATE TABLE "event" (
145
  "id" varbinary(767) NOT NULL,
146
  "parent" varbinary(767) NOT NULL,
147
  "name" varbinary(767) DEFAULT NULL,
148
  "date_range" varbinary(767) DEFAULT NULL,
149
  "place" varbinary(767) DEFAULT NULL,
150
  "method" varbinary(767) DEFAULT NULL,
145
  "id" bytea NOT NULL,
146
  "parent" bytea NOT NULL,
147
  "name" bytea DEFAULT NULL,
148
  "date_range" bytea DEFAULT NULL,
149
  "place" bytea DEFAULT NULL,
150
  "method" bytea DEFAULT NULL,
151 151
  PRIMARY KEY ("id"),
152 152
  /*KEY "fk_event_place1_idx" ("place")*/CHECK (true),
153 153
  /*KEY "fk_event1_idx" ("parent")*/CHECK (true),
......
171 171

  
172 172
DROP TABLE IF EXISTS "event_participant";
173 173
CREATE TABLE "event_participant" (
174
  "event" varbinary(767) NOT NULL,
175
  "party" varbinary(767) NOT NULL,
174
  "event" bytea NOT NULL,
175
  "party" bytea NOT NULL,
176 176
  "sort_order" integer DEFAULT NULL,
177 177
  PRIMARY KEY ("event","party"),
178 178
  /*KEY "fk_event_has_party_party1_idx" ("party")*/CHECK (true),
......
194 194

  
195 195
DROP TABLE IF EXISTS "geological_context";
196 196
CREATE TABLE "geological_context" (
197
  "id" varbinary(767) NOT NULL,
198
  "name" varbinary(767) NOT NULL,
197
  "id" bytea NOT NULL,
198
  "name" bytea NOT NULL,
199 199
  "info" set('hstore') DEFAULT NULL,
200 200
  PRIMARY KEY ("id"),
201 201
  /*CONSTRAINT "fk_geological_context_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
......
214 214

  
215 215
DROP TABLE IF EXISTS "geovalidation";
216 216
CREATE TABLE "geovalidation" (
217
  "id" varbinary(767) NOT NULL,
217
  "id" bytea NOT NULL,
218 218
  "geovalid" integer NOT NULL,
219 219
  "lat_long_domain_valid" integer NOT NULL,
220 220
  "lat_long_in_ranks" set('hstore') DEFAULT NULL,
......
235 235

  
236 236
DROP TABLE IF EXISTS "individual";
237 237
CREATE TABLE "individual" (
238
  "id" varbinary(767) NOT NULL,
239
  "tag" varbinary(767) DEFAULT NULL,
238
  "id" bytea NOT NULL,
239
  "tag" bytea DEFAULT NULL,
240 240
  PRIMARY KEY ("id"),
241 241
  /*CONSTRAINT "fk_individual_record1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
242 242
);
......
254 254

  
255 255
DROP TABLE IF EXISTS "individual_observation";
256 256
CREATE TABLE "individual_observation" (
257
  "id" varbinary(767) NOT NULL,
258
  "individual" varbinary(767) DEFAULT NULL,
259
  "code" varbinary(767) DEFAULT NULL,
257
  "id" bytea NOT NULL,
258
  "individual" bytea DEFAULT NULL,
259
  "code" bytea DEFAULT NULL,
260 260
  "traits" set('hstore') DEFAULT NULL,
261 261
  PRIMARY KEY ("id"),
262 262
  /*KEY "fk_individual_observation_individual1_idx" ("individual")*/CHECK (true),
......
277 277

  
278 278
DROP TABLE IF EXISTS "method";
279 279
CREATE TABLE "method" (
280
  "id" varbinary(767) NOT NULL,
281
  "parent" varbinary(767) NOT NULL,
280
  "id" bytea NOT NULL,
281
  "parent" bytea NOT NULL,
282 282
  "info" set('hstore') DEFAULT NULL,
283 283
  PRIMARY KEY ("id"),
284 284
  /*KEY "fk_method_method1_idx" ("parent")*/CHECK (true),
......
299 299

  
300 300
DROP TABLE IF EXISTS "organization";
301 301
CREATE TABLE "organization" (
302
  "id" varbinary(767) NOT NULL,
302
  "id" bytea NOT NULL,
303 303
  "info" set('hstore') DEFAULT NULL,
304 304
  PRIMARY KEY ("id"),
305 305
  /*CONSTRAINT "fk_organization_party1" FOREIGN KEY ("id") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
......
318 318

  
319 319
DROP TABLE IF EXISTS "parsed_taxon_assertion";
320 320
CREATE TABLE "parsed_taxon_assertion" (
321
  "id" varbinary(767) NOT NULL,
322
  "matched_taxon_concept" varbinary(767) DEFAULT NULL,
321
  "id" bytea NOT NULL,
322
  "matched_taxon_concept" bytea DEFAULT NULL,
323 323
  "match_score" float DEFAULT NULL,
324 324
  "match_info" set('hstore') DEFAULT NULL,
325 325
  PRIMARY KEY ("id"),
......
341 341

  
342 342
DROP TABLE IF EXISTS "party";
343 343
CREATE TABLE "party" (
344
  "id" varbinary(767) NOT NULL,
344
  "id" bytea NOT NULL,
345 345
  "info" set('hstore') DEFAULT NULL,
346 346
  PRIMARY KEY ("id"),
347 347
  /*CONSTRAINT "fk_collection_source10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
......
360 360

  
361 361
DROP TABLE IF EXISTS "place";
362 362
CREATE TABLE "place" (
363
  "id" varbinary(767) NOT NULL,
364
  "parent" varbinary(767) NOT NULL,
365
  "coordinates" varbinary(767) DEFAULT NULL,
366
  "path" varbinary(767) DEFAULT NULL,
367
  "locality" varbinary(767) DEFAULT NULL,
363
  "id" bytea NOT NULL,
364
  "parent" bytea NOT NULL,
365
  "coordinates" bytea DEFAULT NULL,
366
  "path" bytea DEFAULT NULL,
367
  "locality" bytea DEFAULT NULL,
368 368
  PRIMARY KEY ("id"),
369 369
  /*KEY "fk_place_coordinates1_idx" ("coordinates")*/CHECK (true),
370 370
  /*KEY "fk_place1_idx" ("parent")*/CHECK (true),
......
388 388

  
389 389
DROP TABLE IF EXISTS "place_observation";
390 390
CREATE TABLE "place_observation" (
391
  "id" varbinary(767) NOT NULL,
392
  "place" varbinary(767) NOT NULL,
391
  "id" bytea NOT NULL,
392
  "place" bytea NOT NULL,
393 393
  "elevation_m" double precision DEFAULT NULL,
394 394
  "slope_incline_deg" double precision DEFAULT NULL,
395 395
  "slope_direction_deg_N" double precision DEFAULT NULL,
396
  "geological_context" varbinary(767) DEFAULT NULL,
397
  "community" varbinary(767) DEFAULT NULL,
396
  "geological_context" bytea DEFAULT NULL,
397
  "community" bytea DEFAULT NULL,
398 398
  "observations" set('hstore') DEFAULT NULL,
399 399
  PRIMARY KEY ("id"),
400 400
  /*KEY "fk_place_observation_place1_idx" ("place")*/CHECK (true),
......
420 420

  
421 421
DROP TABLE IF EXISTS "place_path";
422 422
CREATE TABLE "place_path" (
423
  "id" varbinary(767) NOT NULL,
424
  "continent" varbinary(767) DEFAULT NULL,
425
  "country" varbinary(767) DEFAULT NULL,
426
  "state_province" varbinary(767) DEFAULT NULL,
427
  "county" varbinary(767) DEFAULT NULL,
428
  "municipality" varbinary(767) DEFAULT NULL,
423
  "id" bytea NOT NULL,
424
  "continent" bytea DEFAULT NULL,
425
  "country" bytea DEFAULT NULL,
426
  "state_province" bytea DEFAULT NULL,
427
  "county" bytea DEFAULT NULL,
428
  "municipality" bytea DEFAULT NULL,
429 429
  "ranks" set('hstore') DEFAULT NULL,
430 430
  PRIMARY KEY ("id")
431 431
);
......
443 443

  
444 444
DROP TABLE IF EXISTS "plot";
445 445
CREATE TABLE "plot" (
446
  "id" varbinary(767) NOT NULL,
447
  "name" varbinary(767) DEFAULT NULL,
446
  "id" bytea NOT NULL,
447
  "name" bytea DEFAULT NULL,
448 448
  "area_m2" double precision DEFAULT NULL,
449
  "bounding_box" varbinary(767) DEFAULT NULL,
449
  "bounding_box" bytea DEFAULT NULL,
450 450
  PRIMARY KEY ("id"),
451 451
  /*CONSTRAINT "fk_subplot_place1" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
452 452
);
......
464 464

  
465 465
DROP TABLE IF EXISTS "project";
466 466
CREATE TABLE "project" (
467
  "id" varbinary(767) NOT NULL,
468
  "name" varbinary(767) NOT NULL,
467
  "id" bytea NOT NULL,
468
  "name" bytea NOT NULL,
469 469
  "info" set('hstore') DEFAULT NULL,
470 470
  PRIMARY KEY ("id"),
471 471
  /*CONSTRAINT "fk_project_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
......
484 484

  
485 485
DROP TABLE IF EXISTS "record";
486 486
CREATE TABLE "record" (
487
  "id" varbinary(767) NOT NULL,
488
  "source" varbinary(767) NOT NULL,
489
  "source_id_scope" varbinary(767) DEFAULT NULL,
490
  "source_record_id" varbinary(767) DEFAULT NULL,
487
  "id" bytea NOT NULL,
488
  "source" bytea NOT NULL,
489
  "source_id_scope" bytea DEFAULT NULL,
490
  "source_record_id" bytea DEFAULT NULL,
491 491
  "info" set('hstore') DEFAULT NULL,
492 492
  PRIMARY KEY ("id"),
493 493
  /*CONSTRAINT "record_unique" */UNIQUE ("source","source_id_scope","source_record_id"),
......
508 508

  
509 509
DROP TABLE IF EXISTS "referenced_class";
510 510
CREATE TABLE "referenced_class" (
511
  "id" varbinary(767) NOT NULL,
511
  "id" bytea NOT NULL,
512 512
  PRIMARY KEY ("id"),
513 513
  /*CONSTRAINT "fk_example_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
514 514
);
......
526 526

  
527 527
DROP TABLE IF EXISTS "relationship";
528 528
CREATE TABLE "relationship" (
529
  "id" varbinary(767) NOT NULL,
530
  "record" varbinary(767) NOT NULL,
531
  "related_record" varbinary(767) NOT NULL,
529
  "id" bytea NOT NULL,
530
  "record" bytea NOT NULL,
531
  "related_record" bytea NOT NULL,
532 532
  "info" set('hstore') DEFAULT NULL,
533 533
  PRIMARY KEY ("id"),
534 534
  /*KEY "fk_relationship_record1_idx" ("record")*/CHECK (true),
......
551 551

  
552 552
DROP TABLE IF EXISTS "soil_observation";
553 553
CREATE TABLE "soil_observation" (
554
  "id" varbinary(767) NOT NULL,
554
  "id" bytea NOT NULL,
555 555
  "observations" set('hstore') DEFAULT NULL,
556 556
  PRIMARY KEY ("id"),
557 557
  /*CONSTRAINT "fk_soil_observation_place_observation1" FOREIGN KEY ("id") REFERENCES "place_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
......
570 570

  
571 571
DROP TABLE IF EXISTS "source";
572 572
CREATE TABLE "source" (
573
  "id" varbinary(767) NOT NULL,
574
  "parent" varbinary(767) NOT NULL,
575
  "name" varbinary(767) NOT NULL,
576
  "first_publisher" varbinary(767) DEFAULT NULL,
577
  "owner" varbinary(767) DEFAULT NULL,
573
  "id" bytea NOT NULL,
574
  "parent" bytea NOT NULL,
575
  "name" bytea NOT NULL,
576
  "first_publisher" bytea DEFAULT NULL,
577
  "owner" bytea DEFAULT NULL,
578 578
  "info" set('hstore') DEFAULT NULL,
579 579
  PRIMARY KEY ("id"),
580 580
  /*CONSTRAINT "source_unique" */UNIQUE ("parent","name"),
......
599 599

  
600 600
DROP TABLE IF EXISTS "specimen";
601 601
CREATE TABLE "specimen" (
602
  "id" varbinary(767) NOT NULL,
603
  "individual" varbinary(767) DEFAULT NULL,
604
  "code_in_individual" varbinary(767) DEFAULT NULL,
605
  "collection_event" varbinary(767) DEFAULT NULL,
606
  "orig_collection" varbinary(767) DEFAULT NULL,
607
  "barcode" varbinary(767) DEFAULT NULL,
608
  "accession_number" varbinary(767) DEFAULT NULL,
609
  "current_collection" varbinary(767) DEFAULT NULL,
610
  "owner_collection" varbinary(767) DEFAULT NULL,
602
  "id" bytea NOT NULL,
603
  "individual" bytea DEFAULT NULL,
604
  "code_in_individual" bytea DEFAULT NULL,
605
  "collection_event" bytea DEFAULT NULL,
606
  "orig_collection" bytea DEFAULT NULL,
607
  "barcode" bytea DEFAULT NULL,
608
  "accession_number" bytea DEFAULT NULL,
609
  "current_collection" bytea DEFAULT NULL,
610
  "owner_collection" bytea DEFAULT NULL,
611 611
  PRIMARY KEY ("id"),
612 612
  /*CONSTRAINT "specimen_unique_in_individual" */UNIQUE ("individual","code_in_individual"),
613 613
  /*CONSTRAINT "specimen_unique_by_collection_event" */UNIQUE ("collection_event"),
......
639 639

  
640 640
DROP TABLE IF EXISTS "specimen_observation";
641 641
CREATE TABLE "specimen_observation" (
642
  "id" varbinary(767) NOT NULL,
643
  "specimen" varbinary(767) NOT NULL,
642
  "id" bytea NOT NULL,
643
  "specimen" bytea NOT NULL,
644 644
  "traits" set('hstore') DEFAULT NULL,
645 645
  PRIMARY KEY ("id"),
646 646
  /*KEY "fk_specimen_observation_specimen1_idx" ("specimen")*/CHECK (true),
......
661 661

  
662 662
DROP TABLE IF EXISTS "stem";
663 663
CREATE TABLE "stem" (
664
  "id" varbinary(767) NOT NULL,
665
  "individual" varbinary(767) NOT NULL,
664
  "id" bytea NOT NULL,
665
  "individual" bytea NOT NULL,
666 666
  PRIMARY KEY ("id"),
667 667
  /*KEY "fk_stem_individual1_idx" ("individual")*/CHECK (true),
668 668
  /*CONSTRAINT "fk_stem_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
......
682 682

  
683 683
DROP TABLE IF EXISTS "stem_observation";
684 684
CREATE TABLE "stem_observation" (
685
  "id" varbinary(767) NOT NULL,
686
  "individual_observation" varbinary(767) NOT NULL,
687
  "stem" varbinary(767) DEFAULT NULL,
685
  "id" bytea NOT NULL,
686
  "individual_observation" bytea NOT NULL,
687
  "stem" bytea DEFAULT NULL,
688 688
  "traits" set('hstore') DEFAULT NULL,
689 689
  PRIMARY KEY ("id"),
690 690
  /*CONSTRAINT "stem_observation_unique" */UNIQUE ("individual_observation","stem"),
......
708 708

  
709 709
DROP TABLE IF EXISTS "stratum";
710 710
CREATE TABLE "stratum" (
711
  "id" varbinary(767) NOT NULL,
712
  "name" varbinary(767) NOT NULL,
711
  "id" bytea NOT NULL,
712
  "name" bytea NOT NULL,
713 713
  "info" set('hstore') DEFAULT NULL,
714 714
  PRIMARY KEY ("id"),
715 715
  /*CONSTRAINT "fk_place_path_record10" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
......
728 728

  
729 729
DROP TABLE IF EXISTS "subplot";
730 730
CREATE TABLE "subplot" (
731
  "id" varbinary(767) NOT NULL,
731
  "id" bytea NOT NULL,
732 732
  "x_m" double precision DEFAULT NULL,
733 733
  "y_m" double precision DEFAULT NULL,
734 734
  PRIMARY KEY ("id"),
......
748 748

  
749 749
DROP TABLE IF EXISTS "taxon_assertion";
750 750
CREATE TABLE "taxon_assertion" (
751
  "id" varbinary(767) NOT NULL,
752
  "string" varbinary(767) NOT NULL,
753
  "taxon" varbinary(767) DEFAULT NULL,
754
  "cf_aff" varbinary(767) DEFAULT NULL,
751
  "id" bytea NOT NULL,
752
  "string" bytea NOT NULL,
753
  "taxon" bytea DEFAULT NULL,
754
  "cf_aff" bytea DEFAULT NULL,
755 755
  "annotations" set('hstore') DEFAULT NULL,
756 756
  PRIMARY KEY ("id"),
757 757
  /*KEY "fk_taxon_assertion_taxon_string1_idx" ("string")*/CHECK (true),
......
774 774

  
775 775
DROP TABLE IF EXISTS "taxon_concept";
776 776
CREATE TABLE "taxon_concept" (
777
  "id" varbinary(767) NOT NULL,
778
  "according_to" varbinary(767) NOT NULL,
779
  "parent" varbinary(767) NOT NULL,
780
  "accepted_taxon_concept" varbinary(767) DEFAULT NULL,
777
  "id" bytea NOT NULL,
778
  "according_to" bytea NOT NULL,
779
  "parent" bytea NOT NULL,
780
  "accepted_taxon_concept" bytea DEFAULT NULL,
781 781
  PRIMARY KEY ("id"),
782 782
  /*CONSTRAINT "taxon_concept_unique_name" */UNIQUE ("according_to"),
783 783
  /*KEY "fk_taxon_taxon1_idx" ("parent")*/CHECK (true),
......
802 802

  
803 803
DROP TABLE IF EXISTS "taxon_determination";
804 804
CREATE TABLE "taxon_determination" (
805
  "id" varbinary(767) NOT NULL,
806
  "taxon_assertion" varbinary(767) NOT NULL,
807
  "identified_by" varbinary(767) DEFAULT NULL,
805
  "id" bytea NOT NULL,
806
  "taxon_assertion" bytea NOT NULL,
807
  "identified_by" bytea DEFAULT NULL,
808 808
  "fit_info" set('hstore') DEFAULT NULL,
809 809
  PRIMARY KEY ("id"),
810 810
  /*CONSTRAINT "taxon_determination_unique" */UNIQUE ("taxon_assertion","identified_by"),
......
828 828

  
829 829
DROP TABLE IF EXISTS "taxon_name";
830 830
CREATE TABLE "taxon_name" (
831
  "id" varbinary(767) NOT NULL,
832
  "unique_name" varbinary(767) NOT NULL,
833
  "formal_name" varbinary(767) DEFAULT NULL,
834
  "taxon_name" varbinary(767) DEFAULT NULL,
835
  "author" varbinary(767) DEFAULT NULL,
836
  "common_name" varbinary(767) DEFAULT NULL,
837
  "rank" varbinary(767) DEFAULT NULL,
831
  "id" bytea NOT NULL,
832
  "unique_name" bytea NOT NULL,
833
  "formal_name" bytea DEFAULT NULL,
834
  "taxon_name" bytea DEFAULT NULL,
835
  "author" bytea DEFAULT NULL,
836
  "common_name" bytea DEFAULT NULL,
837
  "rank" bytea DEFAULT NULL,
838 838
  PRIMARY KEY ("id"),
839 839
  /*KEY "fk_taxon_concept_taxon_string10_idx" ("unique_name")*/CHECK (true),
840 840
  /*CONSTRAINT "fk_taxon_concept_taxon_string10" FOREIGN KEY ("unique_name") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
......
854 854

  
855 855
DROP TABLE IF EXISTS "taxon_observation";
856 856
CREATE TABLE "taxon_observation" (
857
  "id" varbinary(767) NOT NULL,
858
  "taxon_occurrence" varbinary(767) NOT NULL,
859
  "collector" varbinary(767) DEFAULT NULL,
860
  "collector_number" varbinary(767) DEFAULT NULL,
861
  "voucher" varbinary(767) DEFAULT NULL,
862
  "growth_form" varbinary(767) DEFAULT NULL,
857
  "id" bytea NOT NULL,
858
  "taxon_occurrence" bytea NOT NULL,
859
  "collector" bytea DEFAULT NULL,
860
  "collector_number" bytea DEFAULT NULL,
861
  "voucher" bytea DEFAULT NULL,
862
  "growth_form" bytea DEFAULT NULL,
863 863
  "cultivated" integer DEFAULT NULL,
864 864
  "traits" set('hstore') DEFAULT NULL,
865 865
  PRIMARY KEY ("id"),
......
885 885

  
886 886
DROP TABLE IF EXISTS "taxon_occurrence";
887 887
CREATE TABLE "taxon_occurrence" (
888
  "id" varbinary(767) NOT NULL,
889
  "current_determination" varbinary(767) DEFAULT NULL,
890
  "original_determination" varbinary(767) DEFAULT NULL,
888
  "id" bytea NOT NULL,
889
  "current_determination" bytea DEFAULT NULL,
890
  "original_determination" bytea DEFAULT NULL,
891 891
  PRIMARY KEY ("id"),
892 892
  /*KEY "fk_taxon_occurrence_taxon_determination1_idx" ("original_determination")*/CHECK (true),
893 893
  /*KEY "fk_taxon_occurrence_taxon_determination2_idx" ("current_determination")*/CHECK (true),
......
909 909

  
910 910
DROP TABLE IF EXISTS "taxon_path";
911 911
CREATE TABLE "taxon_path" (
912
  "id" varbinary(767) NOT NULL,
913
  "family" varbinary(767) DEFAULT NULL,
914
  "genus" varbinary(767) DEFAULT NULL,
915
  "specific_epithet" varbinary(767) DEFAULT NULL,
912
  "id" bytea NOT NULL,
913
  "family" bytea DEFAULT NULL,
914
  "genus" bytea DEFAULT NULL,
915
  "specific_epithet" bytea DEFAULT NULL,
916 916
  "ranks" set('hstore') DEFAULT NULL,
917 917
  PRIMARY KEY ("id"),
918 918
  /*CONSTRAINT "fk_taxon_path_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
......
931 931

  
932 932
DROP TABLE IF EXISTS "taxon_presence";
933 933
CREATE TABLE "taxon_presence" (
934
  "id" varbinary(767) NOT NULL,
935
  "taxon_concept" varbinary(767) NOT NULL,
934
  "id" bytea NOT NULL,
935
  "taxon_concept" bytea NOT NULL,
936 936
  "traits" set('hstore') DEFAULT NULL,
937 937
  PRIMARY KEY ("id"),
938 938
  /*KEY "fk_taxon_presence_taxon_name1_idx" ("taxon_concept")*/CHECK (true),
......
953 953

  
954 954
DROP TABLE IF EXISTS "taxon_string";
955 955
CREATE TABLE "taxon_string" (
956
  "string" varbinary(767) NOT NULL,
957
  "parsed_taxon_assertion" varbinary(767) DEFAULT NULL,
956
  "string" bytea NOT NULL,
957
  "parsed_taxon_assertion" bytea DEFAULT NULL,
958 958
  PRIMARY KEY ("string"),
959 959
  /*KEY "fk_taxon_string_parsed_taxon_assertion1_idx" ("parsed_taxon_assertion")*/CHECK (true),
960 960
  /*CONSTRAINT "fk_taxon_string_parsed_taxon_assertion1" FOREIGN KEY ("parsed_taxon_assertion") REFERENCES "parsed_taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
......
973 973

  
974 974
DROP TABLE IF EXISTS "validatable_place";
975 975
CREATE TABLE "validatable_place" (
976
  "id" varbinary(767) NOT NULL,
977
  "coordinates" varbinary(767) NOT NULL,
978
  "path" varbinary(767) NOT NULL,
976
  "id" bytea NOT NULL,
977
  "coordinates" bytea NOT NULL,
978
  "path" bytea NOT NULL,
979 979
  PRIMARY KEY ("id"),
980 980
  /*CONSTRAINT "validatable_place_unique" */UNIQUE ("path","coordinates"),
981 981
  /*KEY "fk_geovalidation_place_path1_idx" ("path")*/CHECK (true),
bin/my2pg
17 17
-e "s/\/\*.* (SET NAMES )([0-9A-Za-z_]+) \*\/;/\1'\2';/" \
18 18
-e 's/ (CHARACTER SET|COLLATE) [0-9A-Za-z_]+//g' \
19 19
-e "s/ COMMENT '[^']*'//g" \
20
-e 's/ (binary|blob)/ bytea/g' \
20
-e 's/ (binary|blob|varbinary)/ bytea/g' \
21 21
-e 's/ (tinytext|mediumtext|longtext)/ text/g' \
22 22
-e 's/ (int|mediumint|smallint|tinyint)([ (])/ integer\2/g' \
23 23
-e 's/ double/ double precision/g' \

Also available in: Unified diff