CSV to Postgres
Download branch csv_postgres2. Modify the database.yml or application.yml to fit your need
IMP: Make sure your gemfile has "activerecord-import" and "smartercsv" for your appropriate environment before starting the process.
Export the latest Headers, Hros, Notes, Pseudo Streets, Signs with XYs, Standards with categories, subcategories from the database to individual Flat files. Make sure they all have tab "\t" delimiter on column level and "{CR}{LF}" on Rows.
Make sure the files names follow this conventions:
- headers.csv
- hros.csv
- notes.csv
- pseudo_streets.csv
- signs_with_xys.csv
- standards_with_categories.csv
- subcategories.csv
Transfer the files to the "db\/data" in the sims app.
Navigate to the "bin\/loaders\/csv_postgres_new"
Open 7 screens on same working directory(This is not necessary but signs_with_xys, notes and headers are recommended to be executed in individual screens.)
run each files with ruby command on individual screens.
ruby headers.csv.rb #on Screen 1 ruby hros.csv.rb #on Screen 2 ruby notes.csv.rb #on Screen 3 ruby pseudo_streets.rb #on Screen 4 ruby signs_with_xys.rb #on Screen 5 ruby standards_with_categories.rb #on Screen 6 ruby subcategories.rb #on Screen 7