Project

General

Profile

« Previous | Next » 

Revision 5859

schemas/vegbien.sql: Added coordinates table

View differences:

vegbien.sql
2173 2173

  
2174 2174

  
2175 2175
--
2176
-- Name: coordinates; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2177
--
2178

  
2179
CREATE TABLE coordinates (
2180
    coordinates_id integer NOT NULL,
2181
    creator_id integer NOT NULL,
2182
    latitude_deg double precision NOT NULL,
2183
    longitude_deg double precision NOT NULL,
2184
    verbatimlatitude text,
2185
    verbatimlongitude text,
2186
    verbatimcoordinates text,
2187
    footprintgeometry_dwc text,
2188
    coordsaccuracy_deg double precision
2189
);
2190

  
2191

  
2192
--
2193
-- Name: COLUMN coordinates.footprintgeometry_dwc; Type: COMMENT; Schema: public; Owner: -
2194
--
2195

  
2196
COMMENT ON COLUMN coordinates.footprintgeometry_dwc IS 'DwC''s footprintWKT field. "A Well-Known Text (WKT) representation of the shape (footprint, geometry) that defines the Location" (http://rs.tdwg.org/dwc/terms/#footprintWKT).';
2197

  
2198

  
2199
--
2200
-- Name: COLUMN coordinates.coordsaccuracy_deg; Type: COMMENT; Schema: public; Owner: -
2201
--
2202

  
2203
COMMENT ON COLUMN coordinates.coordsaccuracy_deg IS 'Accuracy of latitude/longitude or footprint geometry, in meters. This should generally be at least 1 m, which is the accuracy of the best GPSes.';
2204

  
2205

  
2206
--
2207
-- Name: coordinates_coordinates_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2208
--
2209

  
2210
CREATE SEQUENCE coordinates_coordinates_id_seq
2211
    START WITH 1
2212
    INCREMENT BY 1
2213
    NO MINVALUE
2214
    NO MAXVALUE
2215
    CACHE 1;
2216

  
2217

  
2218
--
2219
-- Name: coordinates_coordinates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2220
--
2221

  
2222
ALTER SEQUENCE coordinates_coordinates_id_seq OWNED BY coordinates.coordinates_id;
2223

  
2224

  
2225
--
2176 2226
-- Name: coverindex; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2177 2227
--
2178 2228

  
......
3819 3869

  
3820 3870

  
3821 3871
--
3872
-- Name: coordinates_id; Type: DEFAULT; Schema: public; Owner: -
3873
--
3874

  
3875
ALTER TABLE coordinates ALTER COLUMN coordinates_id SET DEFAULT nextval('coordinates_coordinates_id_seq'::regclass);
3876

  
3877

  
3878
--
3822 3879
-- Name: coverindex_id; Type: DEFAULT; Schema: public; Owner: -
3823 3880
--
3824 3881

  
......
4267 4324

  
4268 4325

  
4269 4326
--
4327
-- Name: coordinates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4328
--
4329

  
4330
ALTER TABLE ONLY coordinates
4331
    ADD CONSTRAINT coordinates_pkey PRIMARY KEY (coordinates_id);
4332

  
4333

  
4334
--
4270 4335
-- Name: coverindex_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4271 4336
--
4272 4337

  
......
4796 4861

  
4797 4862

  
4798 4863
--
4864
-- Name: coordinates_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4865
--
4866

  
4867
CREATE UNIQUE INDEX coordinates_unique ON coordinates USING btree (creator_id, latitude_deg, longitude_deg, (COALESCE(verbatimlatitude, '\\N'::text)), (COALESCE(verbatimlongitude, '\\N'::text)), (COALESCE(verbatimcoordinates, '\\N'::text)), (COALESCE(footprintgeometry_dwc, '\\N'::text)));
4868

  
4869

  
4870
--
4799 4871
-- Name: covermethod_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4800 4872
--
4801 4873

  
......
5518 5590

  
5519 5591

  
5520 5592
--
5593
-- Name: coordinates_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5594
--
5595

  
5596
ALTER TABLE ONLY coordinates
5597
    ADD CONSTRAINT coordinates_creator_id_fkey FOREIGN KEY (creator_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
5598

  
5599

  
5600
--
5521 5601
-- Name: coverindex_covermethod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5522 5602
--
5523 5603

  

Also available in: Unified diff