Project

General

Profile

« Previous | Next » 

Revision 11482

schemas/vegbien.sql: sync_analytical_stem_to_view(): row_num: renamed to taxon_occurrence__pkey because previous taxon determinations have been removed, so each row is in fact a taxon_occurrence (~= VegCore.vegpath.org?ERD.taxon_occurrence)

View differences:

schemas/vegbien.my.sql
834 834
    `individualObservationID` varchar(255),
835 835
    `individualCode` varchar(255),
836 836
    `authorStemCode` varchar(255),
837
    row_num int(11) NOT NULL
837
    taxon_occurrence__pkey int(11) NOT NULL
838 838
);
839 839

  
840 840

  
......
966 966

  
967 967

  
968 968
--
969
-- Name: analytical_stem_row_num_seq; Type: SEQUENCE; Schema: public; Owner: -
969
-- Name: analytical_stem_taxon_occurrence__pkey_seq; Type: SEQUENCE; Schema: public; Owner: -
970 970
--
971 971

  
972 972

  
973 973

  
974 974

  
975 975
--
976
-- Name: analytical_stem_row_num_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
976
-- Name: analytical_stem_taxon_occurrence__pkey_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
977 977
--
978 978

  
979 979

  
980 980

  
981 981

  
982 982
--
983
-- Name: analytical_stem_row_num_seq; Type: SEQUENCE SET; Schema: public; Owner: -
983
-- Name: analytical_stem_taxon_occurrence__pkey_seq; Type: SEQUENCE SET; Schema: public; Owner: -
984 984
--
985 985

  
986 986

  
......
3638 3638

  
3639 3639

  
3640 3640
--
3641
-- Name: row_num; Type: DEFAULT; Schema: public; Owner: -
3641
-- Name: taxon_occurrence__pkey; Type: DEFAULT; Schema: public; Owner: -
3642 3642
--
3643 3643

  
3644 3644

  
......
4535 4535
--
4536 4536

  
4537 4537
ALTER TABLE analytical_stem
4538
    ADD CONSTRAINT analytical_stem_pkey PRIMARY KEY (row_num);
4538
    ADD CONSTRAINT analytical_stem_pkey PRIMARY KEY (taxon_occurrence__pkey);
4539 4539

  
4540 4540

  
4541 4541
--
schemas/vegbien.sql
1260 1260
    
1261 1261
    DROP TABLE IF EXISTS analytical_stem;
1262 1262
    CREATE TABLE analytical_stem AS SELECT * FROM analytical_stem_view LIMIT 0;
1263
    ALTER TABLE analytical_stem ADD COLUMN row_num serial PRIMARY KEY;
1263
    ALTER TABLE analytical_stem ADD COLUMN taxon_occurrence__pkey serial PRIMARY KEY;
1264 1264
    
1265 1265
    GRANT SELECT ON TABLE analytical_stem TO bien_read;
1266 1266
    GRANT SELECT ON TABLE analytical_stem_view TO bien_read;
......
1806 1806
    "individualObservationID" text,
1807 1807
    "individualCode" text,
1808 1808
    "authorStemCode" text,
1809
    row_num integer NOT NULL
1809
    taxon_occurrence__pkey integer NOT NULL
1810 1810
);
1811 1811

  
1812 1812

  
......
1952 1952

  
1953 1953

  
1954 1954
--
1955
-- Name: analytical_stem_row_num_seq; Type: SEQUENCE; Schema: public; Owner: -
1955
-- Name: analytical_stem_taxon_occurrence__pkey_seq; Type: SEQUENCE; Schema: public; Owner: -
1956 1956
--
1957 1957

  
1958
CREATE SEQUENCE analytical_stem_row_num_seq
1958
CREATE SEQUENCE analytical_stem_taxon_occurrence__pkey_seq
1959 1959
    START WITH 1
1960 1960
    INCREMENT BY 1
1961 1961
    NO MINVALUE
......
1964 1964

  
1965 1965

  
1966 1966
--
1967
-- Name: analytical_stem_row_num_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1967
-- Name: analytical_stem_taxon_occurrence__pkey_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1968 1968
--
1969 1969

  
1970
ALTER SEQUENCE analytical_stem_row_num_seq OWNED BY analytical_stem.row_num;
1970
ALTER SEQUENCE analytical_stem_taxon_occurrence__pkey_seq OWNED BY analytical_stem.taxon_occurrence__pkey;
1971 1971

  
1972 1972

  
1973 1973
--
1974
-- Name: analytical_stem_row_num_seq; Type: SEQUENCE SET; Schema: public; Owner: -
1974
-- Name: analytical_stem_taxon_occurrence__pkey_seq; Type: SEQUENCE SET; Schema: public; Owner: -
1975 1975
--
1976 1976

  
1977 1977

  
......
4968 4968

  
4969 4969

  
4970 4970
--
4971
-- Name: row_num; Type: DEFAULT; Schema: public; Owner: -
4971
-- Name: taxon_occurrence__pkey; Type: DEFAULT; Schema: public; Owner: -
4972 4972
--
4973 4973

  
4974
ALTER TABLE ONLY analytical_stem ALTER COLUMN row_num SET DEFAULT nextval('analytical_stem_row_num_seq'::regclass);
4974
ALTER TABLE ONLY analytical_stem ALTER COLUMN taxon_occurrence__pkey SET DEFAULT nextval('analytical_stem_taxon_occurrence__pkey_seq'::regclass);
4975 4975

  
4976 4976

  
4977 4977
--
......
5865 5865
--
5866 5866

  
5867 5867
ALTER TABLE ONLY analytical_stem
5868
    ADD CONSTRAINT analytical_stem_pkey PRIMARY KEY (row_num);
5868
    ADD CONSTRAINT analytical_stem_pkey PRIMARY KEY (taxon_occurrence__pkey);
5869 5869

  
5870 5870

  
5871 5871
--

Also available in: Unified diff