Project

General

Profile

« Previous | Next » 

Revision 11118

schemas/VegCore/ERD/VegCore.ERD.mwb: taxon_observation: added unique constraint on sampling_event, primary_collector, collector_number. reordered these columns in constraint order (path order).

View differences:

schemas/VegCore/ERD/document.mwb.xml
3053 3053
                      <value type="string" key="oldName">sampling_event</value>
3054 3054
                      <link type="object" struct-name="GrtObject" key="owner">16537a20-a7a7-11e2-8ba6-080027bcf912</link>
3055 3055
                    </value>
3056
                    <value type="object" struct-name="db.mysql.Column" id="aecb1a5e-1de2-11e3-b950-080027bcf912" struct-checksum="0x783b5183">
3057
                      <value type="int" key="autoIncrement">0</value>
3058
                      <value type="string" key="characterSetName"></value>
3059
                      <value _ptr_="0xbaf5350" type="list" content-type="object" content-struct-name="db.CheckConstraint" key="checks"/>
3060
                      <value type="string" key="collationName"></value>
3061
                      <value type="string" key="datatypeExplicitParams"></value>
3062
                      <value type="string" key="defaultValue"></value>
3063
                      <value type="int" key="defaultValueIsNull">1</value>
3064
                      <value _ptr_="0xbaf56d0" type="list" content-type="string" key="flags"/>
3065
                      <value type="int" key="isNotNull">0</value>
3066
                      <value type="int" key="length">767</value>
3067
                      <value type="int" key="precision">-1</value>
3068
                      <value type="int" key="scale">-1</value>
3069
                      <link type="object" struct-name="db.SimpleDatatype" key="simpleType">com.mysql.rdbms.mysql.datatype.varbinary</link>
3070
                      <value type="string" key="comment">points to the observation of the same taxon/individual in the parent event; = VegBank.vegpath.org?taxonImportance.taxonObservation_ID</value>
3071
                      <value type="string" key="name">observation_in_parent_event</value>
3072
                      <value type="string" key="oldName">observation_in_parent_event</value>
3073
                      <link type="object" struct-name="GrtObject" key="owner">16537a20-a7a7-11e2-8ba6-080027bcf912</link>
3074
                    </value>
3075 3056
                    <value type="object" struct-name="db.mysql.Column" id="713ff8dc-2998-11e3-a80d-080027bcf912" struct-checksum="0x783b5183">
3076 3057
                      <value type="int" key="autoIncrement">0</value>
3077 3058
                      <value type="string" key="characterSetName"></value>
......
3129 3110
                      <value type="string" key="oldName">all_collectors</value>
3130 3111
                      <link type="object" struct-name="GrtObject" key="owner">16537a20-a7a7-11e2-8ba6-080027bcf912</link>
3131 3112
                    </value>
3113
                    <value type="object" struct-name="db.mysql.Column" id="aecb1a5e-1de2-11e3-b950-080027bcf912" struct-checksum="0x783b5183">
3114
                      <value type="int" key="autoIncrement">0</value>
3115
                      <value type="string" key="characterSetName"></value>
3116
                      <value _ptr_="0xbaf5350" type="list" content-type="object" content-struct-name="db.CheckConstraint" key="checks"/>
3117
                      <value type="string" key="collationName"></value>
3118
                      <value type="string" key="datatypeExplicitParams"></value>
3119
                      <value type="string" key="defaultValue"></value>
3120
                      <value type="int" key="defaultValueIsNull">1</value>
3121
                      <value _ptr_="0xbaf56d0" type="list" content-type="string" key="flags"/>
3122
                      <value type="int" key="isNotNull">0</value>
3123
                      <value type="int" key="length">767</value>
3124
                      <value type="int" key="precision">-1</value>
3125
                      <value type="int" key="scale">-1</value>
3126
                      <link type="object" struct-name="db.SimpleDatatype" key="simpleType">com.mysql.rdbms.mysql.datatype.varbinary</link>
3127
                      <value type="string" key="comment">points to the observation of the same taxon/individual in the parent event; = VegBank.vegpath.org?taxonImportance.taxonObservation_ID</value>
3128
                      <value type="string" key="name">observation_in_parent_event</value>
3129
                      <value type="string" key="oldName">observation_in_parent_event</value>
3130
                      <link type="object" struct-name="GrtObject" key="owner">16537a20-a7a7-11e2-8ba6-080027bcf912</link>
3131
                    </value>
3132 3132
                    <value type="object" struct-name="db.mysql.Column" id="16538808-a7a7-11e2-8ba6-080027bcf912" struct-checksum="0x783b5183">
3133 3133
                      <value type="int" key="autoIncrement">0</value>
3134 3134
                      <value type="string" key="characterSetName"></value>
......
3457 3457
                      <value type="string" key="oldName">fk_taxon_observation_party_list1_idx</value>
3458 3458
                      <link type="object" struct-name="GrtObject" key="owner">16537a20-a7a7-11e2-8ba6-080027bcf912</link>
3459 3459
                    </value>
3460
                    <value type="object" struct-name="db.mysql.Index" id="a2c503c8-299a-11e3-a80d-080027bcf912" struct-checksum="0x309b847a">
3461
                      <value _ptr_="0xdaf4f30" type="list" content-type="object" content-struct-name="db.mysql.IndexColumn" key="columns">
3462
                        <value type="object" struct-name="db.mysql.IndexColumn" id="f50d640a-299e-11e3-a80d-080027bcf912" struct-checksum="0x62630b3c">
3463
                          <value type="int" key="columnLength">0</value>
3464
                          <value type="string" key="comment"></value>
3465
                          <value type="int" key="descend">0</value>
3466
                          <link type="object" struct-name="db.Column" key="referencedColumn">07e2f45e-1dde-11e3-bd5f-080027bcf912</link>
3467
                          <value type="string" key="name"></value>
3468
                          <link type="object" struct-name="GrtObject" key="owner">a2c503c8-299a-11e3-a80d-080027bcf912</link>
3469
                        </value>
3470
                        <value type="object" struct-name="db.mysql.IndexColumn" id="f5988d6e-299e-11e3-a80d-080027bcf912" struct-checksum="0x62630b3c">
3471
                          <value type="int" key="columnLength">0</value>
3472
                          <value type="string" key="comment"></value>
3473
                          <value type="int" key="descend">0</value>
3474
                          <link type="object" struct-name="db.Column" key="referencedColumn">713ff8dc-2998-11e3-a80d-080027bcf912</link>
3475
                          <value type="string" key="name"></value>
3476
                          <link type="object" struct-name="GrtObject" key="owner">a2c503c8-299a-11e3-a80d-080027bcf912</link>
3477
                        </value>
3478
                        <value type="object" struct-name="db.mysql.IndexColumn" id="f5f57fc4-299e-11e3-a80d-080027bcf912" struct-checksum="0x62630b3c">
3479
                          <value type="int" key="columnLength">0</value>
3480
                          <value type="string" key="comment"></value>
3481
                          <value type="int" key="descend">0</value>
3482
                          <link type="object" struct-name="db.Column" key="referencedColumn">58b0d99a-ad00-11e2-b309-080027bcf912</link>
3483
                          <value type="string" key="name"></value>
3484
                          <link type="object" struct-name="GrtObject" key="owner">a2c503c8-299a-11e3-a80d-080027bcf912</link>
3485
                        </value>
3486
                      </value>
3487
                      <value type="string" key="indexKind"></value>
3488
                      <value type="int" key="keyBlockSize">0</value>
3489
                      <value type="string" key="withParser"></value>
3490
                      <value type="string" key="comment"></value>
3491
                      <value type="int" key="deferability">0</value>
3492
                      <value type="string" key="indexType">INDEX</value>
3493
                      <value type="int" key="isPrimary">0</value>
3494
                      <value type="string" key="name">taxon_observation__unique</value>
3495
                      <value type="int" key="unique">0</value>
3496
                      <value type="string" key="oldName"></value>
3497
                      <link type="object" struct-name="GrtObject" key="owner">16537a20-a7a7-11e2-8ba6-080027bcf912</link>
3498
                    </value>
3460 3499
                  </value>
3461 3500
                  <value type="string" key="maxRows"></value>
3462 3501
                  <value type="string" key="mergeInsert"></value>
......
3488 3527
                  <value type="int" key="commentedOut">0</value>
3489 3528
                  <value type="string" key="createDate">2013-04-17 13:52</value>
3490 3529
                  <value _ptr_="0xbaf4058" type="dict" key="customData"/>
3491
                  <value type="string" key="lastChangeDate">2013-09-29 23:27</value>
3530
                  <value type="string" key="lastChangeDate">2013-09-30 00:08</value>
3492 3531
                  <value type="int" key="modelOnly">0</value>
3493 3532
                  <value type="string" key="name">taxon_observation</value>
3494 3533
                  <link type="object" struct-name="GrtNamedObject" key="owner">be8cb246-a6e0-11e2-95e9-080027bcf912</link>
......
17704 17743
              <value type="int" key="visible">1</value>
17705 17744
              <value type="string" key="name"></value>
17706 17745
            </value>
17707
            <value _ptr_="0xbb8bd18" type="list" content-type="object" content-struct-name="model.Object" key="selection">
17708
              <link type="object">f1574d28-011f-11e3-9f3a-080027bcf912</link>
17709
            </value>
17746
            <value _ptr_="0xbb8bd18" type="list" content-type="object" content-struct-name="model.Object" key="selection"/>
17710 17747
            <value type="int" key="updateBlocked">0</value>
17711 17748
            <value type="real" key="width">1.6215e+03</value>
17712 17749
            <value type="real" key="x">0.e+00</value>
......
18351 18388
    <value type="object" struct-name="app.DocumentInfo" id="BEE3982F-55A1-4B2C-914A-CD6953803AB9" struct-checksum="0xbba780b8" key="info">
18352 18389
      <value type="string" key="author">Aaron Marcuse-Kubitza</value>
18353 18390
      <value type="string" key="caption">New Model</value>
18354
      <value type="string" key="dateChanged">2013-09-29 23:34</value>
18391
      <value type="string" key="dateChanged">2013-09-30 00:32</value>
18355 18392
      <value type="string" key="dateCreated">2012-01-19 14:06</value>
18356 18393
      <value type="string" key="description"></value>
18357 18394
      <value type="string" key="project">Name of the project</value>
schemas/VegCore/VegCore.my.sql
1272 1272
  `id` varbinary(767) NOT NULL,
1273 1273
  `taxon_occurrence` varbinary(767) NOT NULL,
1274 1274
  `sampling_event` varbinary(767) DEFAULT NULL,
1275
  `observation_in_parent_event` varbinary(767) DEFAULT NULL COMMENT 'points to the observation of the same taxon/individual in the parent event; = VegBank.vegpath.org?taxonImportance.taxonObservation_ID',
1276 1275
  `primary_collector` varbinary(767) DEFAULT NULL,
1277 1276
  `collector_number` varbinary(767) DEFAULT NULL,
1278 1277
  `all_collectors` varbinary(767) DEFAULT NULL,
1278
  `observation_in_parent_event` varbinary(767) DEFAULT NULL COMMENT 'points to the observation of the same taxon/individual in the parent event; = VegBank.vegpath.org?taxonImportance.taxonObservation_ID',
1279 1279
  `growth_form` varbinary(767) DEFAULT NULL,
1280 1280
  `cultivated` tinyint(1) DEFAULT NULL,
1281 1281
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
......
1285 1285
  KEY `fk_taxon_observation_taxon_observation1_idx` (`observation_in_parent_event`),
1286 1286
  KEY `taxon_observation_id_fkey1_idx` (`primary_collector`),
1287 1287
  KEY `fk_taxon_observation_party_list1_idx` (`all_collectors`),
1288
  CONSTRAINT `fk_taxon_observation_taxon_observation1` FOREIGN KEY (`observation_in_parent_event`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1289
  CONSTRAINT `taxon_observation_id_fkey1` FOREIGN KEY (`primary_collector`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1288
  KEY `taxon_observation__unique` (`sampling_event`,`primary_collector`,`collector_number`),
1290 1289
  CONSTRAINT `fk_taxon_observation_party_list1` FOREIGN KEY (`all_collectors`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1291 1290
  CONSTRAINT `fk_taxon_observation_sampling_event1` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1292 1291
  CONSTRAINT `fk_taxon_observation_taxa_sampling_event1` FOREIGN KEY (`sampling_event`) REFERENCES `taxa_sampling_event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1293
  CONSTRAINT `fk_taxon_observation_taxon_occurrence1` FOREIGN KEY (`taxon_occurrence`) REFERENCES `taxon_occurrence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1292
  CONSTRAINT `fk_taxon_observation_taxon_observation1` FOREIGN KEY (`observation_in_parent_event`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1293
  CONSTRAINT `fk_taxon_observation_taxon_occurrence1` FOREIGN KEY (`taxon_occurrence`) REFERENCES `taxon_occurrence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1294
  CONSTRAINT `taxon_observation_id_fkey1` FOREIGN KEY (`primary_collector`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1294 1295
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= DwC.vegpath.org?Occurrence (which actually represents an *observation* of an occurrence)';
1295 1296
/*!40101 SET character_set_client = @saved_cs_client */;
1296 1297

  
schemas/VegCore/VegCore.pg.sql
1274 1274
  "id" text NOT NULL,
1275 1275
  "taxon_occurrence" text NOT NULL,
1276 1276
  "sampling_event" text DEFAULT NULL,
1277
  "observation_in_parent_event" text DEFAULT NULL /*COMMENT 'points to the observation of the same taxon/individual in the parent event; = VegBank.vegpath.org?taxonImportance.taxonObservation_ID'*/,
1278 1277
  "primary_collector" text DEFAULT NULL,
1279 1278
  "collector_number" text DEFAULT NULL,
1280 1279
  "all_collectors" text DEFAULT NULL,
1280
  "observation_in_parent_event" text DEFAULT NULL /*COMMENT 'points to the observation of the same taxon/individual in the parent event; = VegBank.vegpath.org?taxonImportance.taxonObservation_ID'*/,
1281 1281
  "growth_form" text DEFAULT NULL,
1282 1282
  "cultivated" integer DEFAULT NULL,
1283 1283
  "traits" hstore DEFAULT NULL,
......
1287 1287
  /*KEY "fk_taxon_observation_taxon_observation1_idx" ("observation_in_parent_event")*/CHECK (true),
1288 1288
  /*KEY "taxon_observation_id_fkey1_idx" ("primary_collector")*/CHECK (true),
1289 1289
  /*KEY "fk_taxon_observation_party_list1_idx" ("all_collectors")*/CHECK (true),
1290
  /*CONSTRAINT "fk_taxon_observation_taxon_observation1" FOREIGN KEY ("observation_in_parent_event") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1291
  /*CONSTRAINT "taxon_observation_id_fkey1" FOREIGN KEY ("primary_collector") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1290
  /*KEY "taxon_observation__unique" ("sampling_event","primary_collector","collector_number")*/CHECK (true),
1292 1291
  /*CONSTRAINT "fk_taxon_observation_party_list1" FOREIGN KEY ("all_collectors") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1293 1292
  /*CONSTRAINT "fk_taxon_observation_sampling_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1294 1293
  /*CONSTRAINT "fk_taxon_observation_taxa_sampling_event1" FOREIGN KEY ("sampling_event") REFERENCES "taxa_sampling_event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1295
  /*CONSTRAINT "fk_taxon_observation_taxon_occurrence1" FOREIGN KEY ("taxon_occurrence") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1294
  /*CONSTRAINT "fk_taxon_observation_taxon_observation1" FOREIGN KEY ("observation_in_parent_event") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1295
  /*CONSTRAINT "fk_taxon_observation_taxon_occurrence1" FOREIGN KEY ("taxon_occurrence") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1296
  /*CONSTRAINT "taxon_observation_id_fkey1" FOREIGN KEY ("primary_collector") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1296 1297
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= DwC.vegpath.org?Occurrence (which actually represents an *observation* of an occurrence)'*/;
1297 1298
/*!40101 SET character_set_client = @saved_cs_client */;
1298 1299

  

Also available in: Unified diff