Opened 7 years ago

Closed 7 years ago

#1885 closed gap (fixed)

schema changes to taxonomy noxious

Reported by: Melanie Schori Owned by: Benjamin Haag
Priority: medium Milestone: Server 1.10.6
Component: Dataviews (CT) Version: N/A
Severity: Keywords:
Cc: quinn.sinnott@…, benjamin.haag@… Database Engine: N/A
Operating System: N/A

Description

We are adding plant regulatory data to the taxonomy_noxious table at the request of curators to flag material that can't be shipped to certain states. Hawaii regulates entire families, including Orchidaceae and Bromeliaceae, which have many genera and species. It isn't feasible to enter them using species ID records.

Please add a field for Extended Family (to use the primary key from taxonomy_family) and a field for Extended Genus (to use the primary key from taxonomy_genus). This parallels what is used in the common name table and will allow us to enter families (including subfamilial records) and genera (including subgeneric records) without relying on Genus spp., our current approach for indicating that a whole genus is regulated. This causes problems because Genus spp. is used in a different sense for accessions. Subsequent SQL code will be needed to correctly design searches for a noxious page, which doesn't currently exist.

Change History (5)

comment:1 by Melanie Schori, 7 years ago

Cc: quinn.sinnott@… benjamin.haag@… added

Approved by AdCom. Please implement on dev.

comment:2 by Kurt Endress, 7 years ago

Owner: changed from Kurt Endress to Benjamin Haag
Status: new → assigned

This means adding FK fields taxonomy_family_id and taxonomy_genus_id to the taxonomy_noxious table. Then adding the friendly names Extended Family and Extended Genus to the sys_table_field_lang table using the AT. The get_taxonomy_noxious dataviews will need to be modified to include the two new fields.

comment:3 by Benjamin Haag, 7 years ago

Table has been modified on dev:

CREATE TABLE [dbo].[taxonomy_noxious](

[taxonomy_noxious_id] [int] IDENTITY(1,1) NOT NULL,
[taxonomy_species_id] [int] NOT NULL,
[geography_id] [int] NOT NULL,
[noxious_type_code] [nvarchar](20) NOT NULL,
[noxious_level_code] [nvarchar](20) NULL,
[url] [nvarchar](300) NULL,
[note] [nvarchar](max) NULL,
[created_date] [datetime2](7) NOT NULL,
[created_by] [int] NOT NULL,
[modified_date] [datetime2](7) NULL,
[modified_by] [int] NULL,
[owned_date] [datetime2](7) NOT NULL,
[owned_by] [int] NOT NULL,
[taxonomy_family_id] [int] NULL,
[taxonomy_genus_id] [int] NULL,

CONSTRAINT [PK_taxonomy_noxious] PRIMARY KEY CLUSTERED

(

[taxonomy_noxious_id] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[taxonomy_noxious] WITH CHECK ADD CONSTRAINT [FK_taxonomy_noxious_taxonomy_family] FOREIGN KEY([taxonomy_family_id])
REFERENCES [dbo].[taxonomy_family] ([taxonomy_family_id])
GO

ALTER TABLE [dbo].[taxonomy_noxious] CHECK CONSTRAINT [FK_taxonomy_noxious_taxonomy_family]
GO

ALTER TABLE [dbo].[taxonomy_noxious] WITH CHECK ADD CONSTRAINT [FK_taxonomy_noxious_taxonomy_genus] FOREIGN KEY([taxonomy_genus_id])
REFERENCES [dbo].[taxonomy_genus] ([taxonomy_genus_id])
GO

ALTER TABLE [dbo].[taxonomy_noxious] CHECK CONSTRAINT [FK_taxonomy_noxious_taxonomy_genus]
GO

ALTER TABLE [dbo].[taxonomy_noxious] WITH CHECK ADD CONSTRAINT [fk_tn_created] FOREIGN KEY([created_by])
REFERENCES [dbo].[cooperator] ([cooperator_id])
GO

ALTER TABLE [dbo].[taxonomy_noxious] CHECK CONSTRAINT [fk_tn_created]
GO

ALTER TABLE [dbo].[taxonomy_noxious] WITH CHECK ADD CONSTRAINT [fk_tn_g] FOREIGN KEY([geography_id])
REFERENCES [dbo].[geography] ([geography_id])
GO

ALTER TABLE [dbo].[taxonomy_noxious] CHECK CONSTRAINT [fk_tn_g]
GO

ALTER TABLE [dbo].[taxonomy_noxious] WITH CHECK ADD CONSTRAINT [fk_tn_modified] FOREIGN KEY([modified_by])
REFERENCES [dbo].[cooperator] ([cooperator_id])
GO

ALTER TABLE [dbo].[taxonomy_noxious] CHECK CONSTRAINT [fk_tn_modified]
GO

ALTER TABLE [dbo].[taxonomy_noxious] WITH CHECK ADD CONSTRAINT [fk_tn_owned] FOREIGN KEY([owned_by])
REFERENCES [dbo].[cooperator] ([cooperator_id])
GO

ALTER TABLE [dbo].[taxonomy_noxious] CHECK CONSTRAINT [fk_tn_owned]
GO

ALTER TABLE [dbo].[taxonomy_noxious] WITH CHECK ADD CONSTRAINT [fk_tn_ts] FOREIGN KEY([taxonomy_species_id])
REFERENCES [dbo].[taxonomy_species] ([taxonomy_species_id])
GO

ALTER TABLE [dbo].[taxonomy_noxious] CHECK CONSTRAINT [fk_tn_ts]
GO

comment:4 by Benjamin Haag, 7 years ago

Milestone: → Server 1.10.6
Status: assigned → accepted

The taxonomy_noxious table has been superseded by taxonomy_ref_regulation and taxonomy_regulation_map.

comment:5 by Benjamin Haag, 7 years ago

Resolution: → fixed
Status: accepted → closed
Note: See TracTickets for help on using tickets.