Skip to content

rlucha/usda-nutrition-database-migration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

USDA Nutrition Database migration scripts

The USDA Nutrition database is delivered in a not very convenient set of files with weird CSV encoding.

Follow this steps to migrate it to a postgreSQL database.

Steps

  • Clone this repo and navigate to the created folder.

  • Download the USDA files from their website. The files should be under a section called Download SRxx files.

  • Unzip the files in the db/usda_files folder.

  • Run the migration script

chmod +x ./scripts/migrate.sh && ./scripts/migrate.sh

Stack Overflow discussion that pointed me in the direction to create this migration script.

TODO

  • Be able to change the name of the DB on the migration scripts
  • Fix primary keys

About

Migrates the USDA Nutrition Database files to postgreSQL

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages