Project

General

Profile

« Previous | Next » 

Revision 6907

schemas/vegbien.sql: sync_taxon_trait_to_view(): Changed pkey to index because there can be multiple values of the same taxon's trait from different observations

View differences:

schemas/vegbien.my.sql
4864 4864

  
4865 4865

  
4866 4866
--
4867
-- Name: taxon_trait_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4868
--
4869

  
4870
ALTER TABLE taxon_trait
4871
    ADD CONSTRAINT taxon_trait_pkey PRIMARY KEY (`scientificName`, `measurementType`);
4872

  
4873

  
4874
--
4875 4867
-- Name: taxonalt_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4876 4868
--
4877 4869

  
......
5416 5408

  
5417 5409

  
5418 5410
--
5411
-- Name: taxon_trait_scientificName_measurementType_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5412
--
5413

  
5414
CREATE INDEX `taxon_trait_scientificName_measurementType_idx` ON taxon_trait  (`scientificName`, `measurementType`);
5415

  
5416

  
5417
--
5419 5418
-- Name: taxondetermination_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5420 5419
--
5421 5420

  
schemas/vegbien.sql
1023 1023
GRANT SELECT ON TABLE taxon_trait TO bien_read;
1024 1024
GRANT SELECT ON TABLE taxon_trait_view TO bien_read;
1025 1025

  
1026
ALTER TABLE taxon_trait ADD PRIMARY KEY ("scientificName", "measurementType");
1026
ALTER TABLE taxon_trait ALTER COLUMN "scientificName" SET NOT NULL;
1027
ALTER TABLE taxon_trait ALTER COLUMN "measurementType" SET NOT NULL;
1028

  
1029
CREATE INDEX ON taxon_trait ("scientificName", "measurementType" );
1027 1030
$$;
1028 1031

  
1029 1032

  
......
5987 5990

  
5988 5991

  
5989 5992
--
5990
-- Name: taxon_trait_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
5991
--
5992

  
5993
ALTER TABLE ONLY taxon_trait
5994
    ADD CONSTRAINT taxon_trait_pkey PRIMARY KEY ("scientificName", "measurementType");
5995

  
5996

  
5997
--
5998 5993
-- Name: taxonalt_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
5999 5994
--
6000 5995

  
......
6539 6534

  
6540 6535

  
6541 6536
--
6537
-- Name: taxon_trait_scientificName_measurementType_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: 
6538
--
6539

  
6540
CREATE INDEX "taxon_trait_scientificName_measurementType_idx" ON taxon_trait USING btree ("scientificName", "measurementType");
6541

  
6542

  
6543
--
6542 6544
-- Name: taxondetermination_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
6543 6545
--
6544 6546

  

Also available in: Unified diff