#2961 closed enhancement (fixed)
Add a table to GRIN to handle coordinate location data and inventory management data
| Reported by: | Mark J. Millard | Owned by: | Benjamin Haag |
|---|---|---|---|
| Priority: | major | Milestone: | Unassigned |
| Component: | Database, Schema Changes | Version: | N/A |
| Severity: | Keywords: | inventory_location_data | |
| Cc: | pete.cyr@…, marty.reisinger@…, kurt.endress@…, vivian.bernau@… | Database Engine: | N/A |
| Operating System: | N/A |
Description
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.
Attachments (2)
Change History (16)
comment:1 by , 2 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 2 years ago
| Owner: | changed from to |
|---|
comment:4 by , 2 years ago
| Status: | assigned → accepted |
|---|
comment:5 by , 2 years ago
No worries Benjamin. As soon as the testing is completed here in Ames I will attach the ZIP file to this ticket and you can do the install on npgsDev for our continued testing. Thanks!!!
comment:6 by , 2 years ago
Thank you. From today's discussion, this should reduce considerable work on the curatorial side -- certainly for Mark; getting this up and tested and running as rapidly as possible will be a priority.
by , 2 years ago
| Attachment: | Steps to install the nc7_inventory_location_data table.zip added |
|---|
SQL script and step-by-step instructions for installing the new nc7_inventory_location_data table
comment:7 by , 2 years ago
Benjamin... I have uploaded a SQL script and step-by-step instructions for installing the new nc7_inventory_location_data table to your test/dev GRIN-Global server. Please let me know if you have any questions. Thanks!!!
comment:8 by , 2 years ago
Will review.
The document references a 'get_nc7_inventory_location_data' dataview; which ticket contains this?
comment:9 by , 2 years ago
The Maize crew (here in Ames) will be creating another Trac ticket and attaching their new dataview to that ticket. I believe that new dataview is named 'get_nc7_inventory_location_data'. Thanks!!!
comment:11 by , 2 years ago
| Status: | accepted → addressed |
|---|
comment:13 by , 2 years ago
| Resolution: | → fixed |
|---|---|
| Status: | addressed → closed |
comment:14 by , 22 months ago
Works on npgsweb and 900,000 records (all of them) have been added from the local database as of 2025-01-28.

Currently testing the installation package on npgsTest2 server in Ames. As soon as the testing is complete I will update this ticket with a ZIP file containing the installation instructions and SQL scripts.