ERROR: "place" relationships do not exist. Import Heroku db

I know that such an error occurs when there are quotes or case sensitivity errors in the postgres request. Actually, I have a .sql file that I am trying to import into my heroku db file via the command line, but constantly have this error. My .sql file contains these queries

INSERT INTO "places" ("Name", "Address") VALUES ('Cookshop Restaurant &amp', ' Bar'), ('Cafeteria', '119 7th Ave, New York, NY 10011'), ('Franchia Vegan Cafe', '12 Park Ave, New York, NY 10016'); 
+5
source share
1 answer

The problem is that heroku doesn't have the migrations that you locally have in order to have the same db version the following migration to heroku:

To find out the local db version: $ rake db:version

Then grab the version you get locally and make sure you have it in the hero by doing the following:

$ heroku run rake --trace db:migrate VERSION=20151127134901

Explanation: Essentially, the above command transfers the db migration to the hero with the same migration version that you are locally.

Hope this helps!

+6
source

Source: https://habr.com/ru/post/1238419/


All Articles