﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	db_engine	os_version
2961	Add a table to GRIN to handle coordinate location data and inventory management data	Mark J. Millard	Benjamin Haag	"Since 1997, NC7 has been capturing maize pollination date, number of ears pollinated, number of ears harvested, and number of ears shelled and the method of pollination (selfing or sibbing) by row and inventory.  In GRIN-classic, auxillary site tables could be operated in conjunction with the database.  Since 2015, a local GRIN-Global database was created from backups from GRIN production and an auxillary table was created to hold almost 1 million rows of data.  Regularly a backup would need to be provided and the data in this table remarried to production data.  Additionally, current field locations are stored in an NC7 site table that stores the minimum and maximum rows assuming the rows planted to regenerate an inventory are located next to each other.  We would like to take data on a row by row basis and be able to hand coordinate rows rather than sequential rows.  Field planting by machine is much easier to handle using coordinates.  So NC7 is proposing adding this table to GRIN initially to handle NC7 data and perhaps later promoted to all NPGS usage with furthur enhancements.  We have found this table conducive to storing raw stand count data also.

The table is defined as such and P. Cyr is working with the NC7 maize team to provide a script to create the schema.

CREATE TABLE [dbo].[inventory_location_data](
	[inventory_location_data_id] [int] IDENTITY(1,1) NOT NULL,
	[inventory_id] [int] NOT NULL,
	[data_date_code] [nvarchar](20) NULL,
	[data_date] [datetime2](7) NULL,
	[data_date_number] [int] NULL,
	[location_number] [int] NULL,
	[location_string] [nvarchar](50) NULL,
	[sublocation_number] [int] NULL,
	[sublocation_string] [nvarchar](50) NULL,
	[data_type1_code] [nvarchar](20) NOT NULL,
	[data_type2_code] [nvarchar](20) NULL,
	[data_type3_code] [nvarchar](20) NULL,
	[data_type4_code] [nvarchar](20) NULL,
	[numeric_value] [decimal](18, 5) NULL,
	[string_value] [nvarchar](255) NULL,
	[grid_location_code] [nvarchar](20) NULL,
	[grid_location_x] [int] NULL,
	[grid_location_y] [int] NULL,
	[cooperator_id] [int] NULL,
	[method_id] [int] 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...

with all the foreign key relationships normbal for a GRIN-Global table.
Codes currently being used and dataviews scripts will also be provided to the DBMU."	enhancement	closed	major	Unassigned	Database, Schema Changes	N/A		fixed	inventory_location_data	pete.cyr@… marty.reisinger@… kurt.endress@… vivian.bernau@…	N/A	N/A
