ga-wdi-boston / full-stack-project

Other
8 stars 64 forks source link

trying to populate my table using bulk load #1035

Closed 3point14guy closed 7 years ago

3point14guy commented 7 years ago

I am trying to input data en masse into my movies table using psql:

\copy movies(name,year,rating) FROM 'data/movies.csv' WITH (FORMAT csv, HEADER true)

When I try to run the file, I get this message:

rails-api-groovy-movie_development=# \i app/010-bulk-load-movies.psql psql:app/010-bulk-load-movies.psql:1: data/movies.csv: No such file or directory

Where am I going wrong??

cpearce31 commented 7 years ago

If you seed your DB with psql directly, the data will only be available locally, not on your deployed app. If you want to seed the data in the production DB, you'll need to use db/seeds.rb

3point14guy commented 7 years ago

Thank you. I will start looking at that.