thoughtbot / parity

Shell commands for development, staging, and production parity for Heroku apps
https://thoughtbot.com
MIT License
895 stars 57 forks source link

ERROR: relation does not exist #137

Closed axhamre closed 6 years ago

axhamre commented 6 years ago

I can successfully import db from development to staging, but exporting from production to development results in WARNING: errors ignored on restore: 54, like this one:

pg_restore: dropping FK CONSTRAINT events fk_rails_2551b6fe99
pg_restore: [archiver (db)] Error from TOC entry 3013; 2606 169195 FK CONSTRAINT events fk_rails_2551b6fe99 gtdxahketybicf
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "public.events" does not exist
Command was: ALTER TABLE ONLY "public"."events" DROP CONSTRAINT "fk_rails_2551b6fe99";

What in my setup may I have missed? If the config/database.yml has to be in a certain format - is there any sample file to look at?

geoffharcourt commented 6 years ago

@hundsim a couple questions so we can track down what's going on:

  1. Do you know what version of parity you're running?
  2. How did you install parity (Homebrew, apt, Rubygems)?
  3. What does your database.yml look like? Can you paste it here without the password lines?
croaky commented 6 years ago

May not be related, but I just noticed Parity may want to use the --if-exists flag in the dropdb invocation.

Could also add a Issue Template to request issue reporters include which development, brew list parity, etc

geoffharcourt commented 6 years ago

Please let me know if you have more detail we can use to diagnose!