Project

General

Profile

« Previous | Next » 

Revision 5499

schemas/vegbien.sql: Changed `timestamp with time zone` fields to `date` because time information is not stored in these fields, and it's confusing to have an arbitrary timezone (the server's timezone) and an arbitrary time (midnight) set for input data that only has a precision to the nearest day

View differences:

vegbien.sql
533 533
    postalcode text,
534 534
    country text,
535 535
    currentflag boolean,
536
    addressstartdate timestamp with time zone
536
    addressstartdate date
537 537
);
538 538

  
539 539

  
......
565 565
    creator_id integer NOT NULL,
566 566
    sourceaccessioncode text,
567 567
    taxonoccurrence_id integer NOT NULL,
568
    collectiondate timestamp with time zone,
568
    collectiondate date,
569 569
    cover_fraction double precision,
570 570
    linecover_m double precision,
571 571
    basalarea_m2 double precision,
......
666 666
    notespublic boolean,
667 667
    notesmgt boolean,
668 668
    revisions boolean,
669
    dateentered timestamp with time zone DEFAULT now(),
669
    dateentered date DEFAULT now(),
670 670
    locationrationalenarrative text,
671 671
    accessioncode text,
672 672
    CONSTRAINT location_required_key CHECK (((sourceaccessioncode IS NOT NULL) OR (authorlocationcode IS NOT NULL)))
......
695 695
    footprintgeometry_dwc text,
696 696
    coordsaccuracy_deg double precision,
697 697
    identifier_id integer,
698
    determinationdate timestamp with time zone,
698
    determinationdate date,
699 699
    isoriginal boolean DEFAULT false NOT NULL,
700 700
    iscurrent boolean DEFAULT false NOT NULL,
701 701
    calculated boolean
......
787 787
    notespublic boolean,
788 788
    notesmgt boolean,
789 789
    revisions boolean,
790
    obsstartdate timestamp with time zone,
791
    obsenddate timestamp with time zone,
792
    dateentered timestamp with time zone DEFAULT now(),
790
    obsstartdate date,
791
    obsenddate date,
792
    dateentered date DEFAULT now(),
793 793
    toptaxon1name text,
794 794
    toptaxon2name text,
795 795
    toptaxon3name text,
......
1172 1172
    taxonconcept_id integer NOT NULL,
1173 1173
    creator_id integer NOT NULL,
1174 1174
    sourceaccessioncode text,
1175
    creationdate timestamp with time zone,
1175
    creationdate date,
1176 1176
    accepted_concept_id integer,
1177 1177
    matched_concept_id integer,
1178 1178
    matched_concept_fit_fraction double precision,
......
1362 1362
    notespublic boolean,
1363 1363
    notesmgt boolean,
1364 1364
    revisions boolean,
1365
    determinationdate timestamp with time zone,
1365
    determinationdate date,
1366 1366
    accessioncode text
1367 1367
);
1368 1368

  
......
1476 1476
    commcode text,
1477 1477
    commframework text,
1478 1478
    commlevel text,
1479
    classstartdate timestamp with time zone,
1480
    classstopdate timestamp with time zone,
1479
    classstartdate date,
1480
    classstopdate date,
1481 1481
    expertsystem text,
1482 1482
    accessioncode text
1483 1483
);
......
1546 1546
    commstatus_id integer NOT NULL,
1547 1547
    commconcept_id integer NOT NULL,
1548 1548
    commconvergence text NOT NULL,
1549
    correlationstart timestamp with time zone NOT NULL,
1550
    correlationstop timestamp with time zone
1549
    correlationstart date NOT NULL,
1550
    correlationstop date
1551 1551
);
1552 1552

  
1553 1553

  
......
1646 1646
    commname_id integer NOT NULL,
1647 1647
    commname text NOT NULL,
1648 1648
    reference_id integer,
1649
    dateentered timestamp with time zone DEFAULT now()
1649
    dateentered date DEFAULT now()
1650 1650
);
1651 1651

  
1652 1652

  
......
1682 1682
    commlevel text,
1683 1683
    commpartycomments text,
1684 1684
    party_id integer NOT NULL,
1685
    startdate timestamp with time zone NOT NULL,
1686
    stopdate timestamp with time zone,
1685
    startdate date NOT NULL,
1686
    stopdate date,
1687 1687
    accessioncode text
1688 1688
);
1689 1689

  
......
1720 1720
    classsystem text,
1721 1721
    party_id integer,
1722 1722
    commstatus_id integer,
1723
    usagestart timestamp with time zone,
1724
    usagestop timestamp with time zone
1723
    usagestart date,
1724
    usagestop date
1725 1725
);
1726 1726

  
1727 1727

  
......
1899 1899
    graphicdescription text,
1900 1900
    graphictype text,
1901 1901
    graphicdata oid,
1902
    graphicdate timestamp with time zone,
1902
    graphicdate date,
1903 1903
    accessioncode text
1904 1904
);
1905 1905

  
......
1989 1989
    locationevent_id integer NOT NULL,
1990 1990
    party_id integer NOT NULL,
1991 1991
    role role NOT NULL,
1992
    contributiondate timestamp with time zone
1992
    contributiondate date
1993 1993
);
1994 1994

  
1995 1995

  
......
2023 2023
    party_id integer NOT NULL,
2024 2024
    role role NOT NULL,
2025 2025
    synonymcomment text,
2026
    classstartdate timestamp with time zone DEFAULT now() NOT NULL,
2027
    classstopdate timestamp with time zone,
2026
    classstartdate date DEFAULT now() NOT NULL,
2027
    classstopdate date,
2028 2028
    accessioncode text
2029 2029
);
2030 2030

  
......
2145 2145
    role role NOT NULL,
2146 2146
    notetype text NOT NULL,
2147 2147
    notetext text NOT NULL,
2148
    notedate timestamp with time zone,
2148
    notedate date,
2149 2149
    accessioncode text
2150 2150
);
2151 2151

  
......
2228 2228
    parentparty_id integer NOT NULL,
2229 2229
    childparty_id integer NOT NULL,
2230 2230
    role role,
2231
    memberstart timestamp with time zone DEFAULT now() NOT NULL,
2232
    memberstop timestamp with time zone
2231
    memberstart date DEFAULT now() NOT NULL,
2232
    memberstop date
2233 2233
);
2234 2234

  
2235 2235

  
......
2426 2426
    sourceaccessioncode text,
2427 2427
    projectname text,
2428 2428
    projectdescription text,
2429
    startdate timestamp with time zone,
2430
    stopdate timestamp with time zone,
2429
    startdate date,
2430
    stopdate date,
2431 2431
    d_obscount integer,
2432
    d_lastlocationaddeddate timestamp with time zone,
2432
    d_lastlocationaddeddate date,
2433 2433
    accessioncode text,
2434 2434
    CONSTRAINT project_required_key CHECK (((sourceaccessioncode IS NOT NULL) OR (projectname IS NOT NULL)))
2435 2435
);
......
2515 2515
    url text,
2516 2516
    doi text,
2517 2517
    additionalinfo text,
2518
    pubdate timestamp with time zone,
2519
    accessdate timestamp with time zone,
2520
    conferencedate timestamp with time zone,
2518
    pubdate date,
2519
    accessdate date,
2520
    conferencedate date,
2521 2521
    accessioncode text
2522 2522
);
2523 2523

  
......
2685 2685
    previousvaluetext text NOT NULL,
2686 2686
    previousvaluetype text NOT NULL,
2687 2687
    previousrevision_id integer,
2688
    revisiondate timestamp with time zone NOT NULL
2688
    revisiondate date NOT NULL
2689 2689
);
2690 2690

  
2691 2691

  
......
3019 3019
    taxonstatus_id integer NOT NULL,
3020 3020
    taxonconcept_id integer NOT NULL,
3021 3021
    plantconvergence text NOT NULL,
3022
    correlationstart timestamp with time zone NOT NULL,
3023
    correlationstop timestamp with time zone
3022
    correlationstart date NOT NULL,
3023
    correlationstop date
3024 3024
);
3025 3025

  
3026 3026

  
......
3122 3122
    taxonconceptstatus text DEFAULT 'undetermined'::text NOT NULL,
3123 3123
    reference_id integer,
3124 3124
    plantpartycomments text,
3125
    startdate timestamp with time zone,
3126
    stopdate timestamp with time zone,
3125
    startdate date,
3126
    stopdate date,
3127 3127
    accessioncode text
3128 3128
);
3129 3129

  
......
3160 3160
    acceptedsynonym text,
3161 3161
    party_id integer,
3162 3162
    taxonstatus_id integer,
3163
    usagestart timestamp with time zone,
3164
    usagestop timestamp with time zone
3163
    usagestart date,
3164
    usagestop date
3165 3165
);
3166 3166

  
3167 3167

  
......
4422 4422
-- Name: locationevent_unique_within_location; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4423 4423
--
4424 4424

  
4425
CREATE UNIQUE INDEX locationevent_unique_within_location ON locationevent USING btree (location_id, (COALESCE(authoreventcode, '\\N'::text)), (COALESCE(obsstartdate, 'infinity'::timestamp with time zone))) WHERE ((parent_id IS NULL) AND (sourceaccessioncode IS NULL));
4425
CREATE UNIQUE INDEX locationevent_unique_within_location ON locationevent USING btree (location_id, (COALESCE(authoreventcode, '\\N'::text)), (COALESCE(obsstartdate, 'infinity'::date))) WHERE ((parent_id IS NULL) AND (sourceaccessioncode IS NULL));
4426 4426

  
4427 4427

  
4428 4428
--
......
4443 4443
-- Name: locationevent_unique_within_project; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4444 4444
--
4445 4445

  
4446
CREATE UNIQUE INDEX locationevent_unique_within_project ON locationevent USING btree ((COALESCE(project_id, 2147483647)), (COALESCE(authoreventcode, '\\N'::text)), (COALESCE(obsstartdate, 'infinity'::timestamp with time zone))) WHERE ((((parent_id IS NULL) AND (project_id IS NOT NULL)) AND (authoreventcode IS NOT NULL)) AND (obsstartdate IS NOT NULL));
4446
CREATE UNIQUE INDEX locationevent_unique_within_project ON locationevent USING btree ((COALESCE(project_id, 2147483647)), (COALESCE(authoreventcode, '\\N'::text)), (COALESCE(obsstartdate, 'infinity'::date))) WHERE ((((parent_id IS NULL) AND (project_id IS NOT NULL)) AND (authoreventcode IS NOT NULL)) AND (obsstartdate IS NOT NULL));
4447 4447

  
4448 4448

  
4449 4449
--
......
4555 4555
-- Name: project_unique_name_date; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4556 4556
--
4557 4557

  
4558
CREATE UNIQUE INDEX project_unique_name_date ON project USING btree (creator_id, (COALESCE(projectname, '\\N'::text)), (COALESCE(startdate, 'infinity'::timestamp with time zone))) WHERE (sourceaccessioncode IS NULL);
4558
CREATE UNIQUE INDEX project_unique_name_date ON project USING btree (creator_id, (COALESCE(projectname, '\\N'::text)), (COALESCE(startdate, 'infinity'::date))) WHERE (sourceaccessioncode IS NULL);
4559 4559

  
4560 4560

  
4561 4561
--
......
4667 4667
-- Name: taxonconcept_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4668 4668
--
4669 4669

  
4670
CREATE UNIQUE INDEX taxonconcept_unique ON taxonconcept USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(taxonname, '\\N'::text)), (COALESCE(rank, 'unknown'::taxonrank)), creator_id, (COALESCE(sourceaccessioncode, '\\N'::text)), (COALESCE(creationdate, 'infinity'::timestamp with time zone)), (COALESCE(identifyingtaxonomicname, '\\N'::text)), (COALESCE(taxonomicname, '\\N'::text)), (COALESCE(author, '\\N'::text)), (COALESCE(taxonomicnamewithauthor, '\\N'::text)));
4670
CREATE UNIQUE INDEX taxonconcept_unique ON taxonconcept USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(taxonname, '\\N'::text)), (COALESCE(rank, 'unknown'::taxonrank)), creator_id, (COALESCE(sourceaccessioncode, '\\N'::text)), (COALESCE(creationdate, 'infinity'::date)), (COALESCE(identifyingtaxonomicname, '\\N'::text)), (COALESCE(taxonomicname, '\\N'::text)), (COALESCE(author, '\\N'::text)), (COALESCE(taxonomicnamewithauthor, '\\N'::text)));
4671 4671

  
4672 4672

  
4673 4673
--

Also available in: Unified diff