Run rails db:{drop,create,migrate,seed} and you may see lots of output including some warnings/errors from pg_restore that you can ignore
Run rails db:schema:dump . Then, check to see that your schema.rb exists and has the proper tables/attributes that match the data in Postico. You can do the following to check to see if you have set up rails to effectively communicate with the database.
Add a market.rb file to your models directory
Create a Market class that inherits from ApplicationRecord
run rails c to jump into your rails console.
run Market.first to see the object: ##<Market id: 322458, name: "14&U Farmers' Market", street: "1400 U Street NW ", city: "Washington", county: "District of Columbia", state: "District of Columbia", zip: "20009", lat: "38.9169984", lon: "-77.0320505">
run Market.last to see the object: #<Market id: 331081, name: "Year-Round Cedar City Farmer's Market ", street: "905 South Main Street at IFA", city: "Cedar City", county: nil, state: "Utah", zip: "84720", lat: "37.6619", lon: "-113.069">
Run
rails db:{drop,create,migrate,seed}
and you may see lots of output including some warnings/errors frompg_restore
that you can ignoreRun
rails db:schema:dump
. Then, check to see that yourschema.rb
exists and has the proper tables/attributes that match the data in Postico. You can do the following to check to see if you have set up rails to effectively communicate with the database.market.rb
file to your models directoryMarket
class that inherits fromApplicationRecord
rails c
to jump into your rails console.Market.first
to see the object:##<Market id: 322458, name: "14&U Farmers' Market", street: "1400 U Street NW ", city: "Washington", county: "District of Columbia", state: "District of Columbia", zip: "20009", lat: "38.9169984", lon: "-77.0320505">
Market.last
to see the object:#<Market id: 331081, name: "Year-Round Cedar City Farmer's Market ", street: "905 South Main Street at IFA", city: "Cedar City", county: nil, state: "Utah", zip: "84720", lat: "37.6619", lon: "-113.069">
If this all checks out you should be good to go!