Project

General

Profile

« Previous | Next » 

Revision 584

vegbien.sql: Renamed taxonbin to taxonbinmethod to reflect that it does not contain actual organisms (those go in aggregateoccurrence), but rather defined a method of aggregating organisms

View differences:

vegbien.for_ERD.sql
184 184
(
185 185
  aggregateoccurrence_id serial NOT NULL,
186 186
  taxonoccurrence_id integer NOT NULL,
187
  taxonbin_id integer,
187
  taxonbinmethod_id integer,
188 188
  cover double precision,
189 189
  basalarea double precision,
190 190
  biomass double precision,
......
196 196
  count integer NOT NULL,
197 197
  accessioncode character varying(255),
198 198
  CONSTRAINT aggregateoccurrence_pkey PRIMARY KEY (aggregateoccurrence_id ),
199
  CONSTRAINT aggregateoccurrence_taxonbin_id FOREIGN KEY (taxonbin_id)
200
      REFERENCES taxonbin (taxonbin_id) MATCH SIMPLE
199
  CONSTRAINT aggregateoccurrence_taxonbinmethod_id FOREIGN KEY (taxonbinmethod_id)
200
      REFERENCES taxonbinmethod (taxonbinmethod_id) MATCH SIMPLE
201 201
      ON UPDATE CASCADE ON DELETE CASCADE,
202 202
  CONSTRAINT aggregateoccurrence_taxonoccurrence_id FOREIGN KEY (taxonoccurrence_id)
203 203
      REFERENCES taxonoccurrence (taxonoccurrence_id) MATCH SIMPLE
204 204
      ON UPDATE CASCADE ON DELETE CASCADE,
205
  CONSTRAINT aggregateoccurrence_keys UNIQUE (taxonoccurrence_id , taxonbin_id )
205
  CONSTRAINT aggregateoccurrence_keys UNIQUE (taxonoccurrence_id , taxonbinmethod_id )
206 206
);
207 207

  
208 208
CREATE TABLE individualplant -- VegBank's stemcount table.
......
356 356
  CONSTRAINT sizeclass_pkey PRIMARY KEY (sizeclass_id )
357 357
);
358 358

  
359
CREATE TABLE taxonbin -- Defines a set of aggregate measurements. Used by aggregateoccurrence to define how measurements were aggregated.
359
CREATE TABLE taxonbinmethod -- Defines a set of aggregate measurements. Used by aggregateoccurrence to define how measurements were aggregated.
360 360
(
361
  taxonbin_id integer NOT NULL,
361
  taxonbinmethod_id integer NOT NULL,
362 362
  label character varying(255) NOT NULL DEFAULT ''::character varying,
363 363
  stratum_id integer,
364 364
  sizeclass_id integer,
365 365
  coverindex_id integer,
366 366
  accessioncode character varying(255),
367
  CONSTRAINT taxonbin_pkey PRIMARY KEY (taxonbin_id ),
368
  CONSTRAINT taxonbin_sizeclass_id FOREIGN KEY (sizeclass_id)
367
  CONSTRAINT taxonbinmethod_pkey PRIMARY KEY (taxonbinmethod_id ),
368
  CONSTRAINT taxonbinmethod_sizeclass_id FOREIGN KEY (sizeclass_id)
369 369
      REFERENCES sizeclass (sizeclass_id) MATCH SIMPLE
370 370
      ON UPDATE CASCADE ON DELETE CASCADE,
371
  CONSTRAINT taxonbin_keys UNIQUE (label , stratum_id , sizeclass_id , coverindex_id )
371
  CONSTRAINT taxonbinmethod_keys UNIQUE (label , stratum_id , sizeclass_id , coverindex_id )
372 372
);

Also available in: Unified diff