Revision 599
Added by Aaron Marcuse-Kubitza about 13 years ago
schemas/vegbien.for_ERD.my.sql | ||
---|---|---|
31 | 31 |
plantname_id int(11) NOT NULL AUTO_INCREMENT, |
32 | 32 |
plantname character varying(255) NOT NULL, |
33 | 33 |
reference_id int(11), |
34 |
dateentered timestamp DEFAULT now(), |
|
34 |
dateentered timestamp NULL DEFAULT now(),
|
|
35 | 35 |
CONSTRAINT plantname_pkey PRIMARY KEY (plantname_id ), |
36 | 36 |
CONSTRAINT plantname_reference_id FOREIGN KEY (reference_id) |
37 | 37 |
REFERENCES reference (reference_id) MATCH SIMPLE |
... | ... | |
42 | 42 |
( |
43 | 43 |
plantconcept_id int(11) NOT NULL AUTO_INCREMENT, |
44 | 44 |
plantname_id int(11) NOT NULL, |
45 |
reference_id int(11) NOT NULL,
|
|
45 |
reference_id int(11), |
|
46 | 46 |
plantcode character varying(23), |
47 | 47 |
plantdescription text, |
48 | 48 |
d_obscount int(11), |
schemas/vegbien.for_ERD.sql | ||
---|---|---|
42 | 42 |
( |
43 | 43 |
plantconcept_id serial NOT NULL, |
44 | 44 |
plantname_id integer NOT NULL, |
45 |
reference_id integer NOT NULL,
|
|
45 |
reference_id integer, |
|
46 | 46 |
plantcode character varying(23), |
47 | 47 |
plantdescription text, |
48 | 48 |
d_obscount integer, |
schemas/vegbien.sql | ||
---|---|---|
1610 | 1610 |
CREATE TABLE plantconcept ( |
1611 | 1611 |
plantconcept_id integer NOT NULL, |
1612 | 1612 |
plantname_id integer NOT NULL, |
1613 |
reference_id integer NOT NULL,
|
|
1613 |
reference_id integer, |
|
1614 | 1614 |
plantcode character varying(23), |
1615 | 1615 |
plantdescription text, |
1616 | 1616 |
d_obscount integer, |
... | ... | |
5316 | 5316 |
|
5317 | 5317 |
|
5318 | 5318 |
-- |
5319 |
-- Name: plantconcept_keys; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
5320 |
-- |
|
5321 |
|
|
5322 |
CREATE UNIQUE INDEX plantconcept_keys ON plantconcept USING btree ((COALESCE(reference_id, 0)), plantname_id); |
|
5323 |
|
|
5324 |
|
|
5325 |
-- |
|
5319 | 5326 |
-- Name: plantconcept_plantname_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: |
5320 | 5327 |
-- |
5321 | 5328 |
|
Also available in: Unified diff
vegbien.sql: Made plantconcept.reference_id optional. Merge plantconcepts with no reference_id when eliminating duplicates.