ankane/multiverse

`rake db:test:prepare` tries to load `db/structure.sql` twice

isaiah opened this issue · 4 comments

`rake db:test:prepare` tries to load `db/structure.sql` twice

Hey @isaiah, thanks for reporting. Can you provide more info to help debug? A few things that would be helpful are:

  • the commands you're running and their output
  • more info on why you think it's loading twice

Command and output:

bundle exec rake db:test:prepare                                          :(
I, [2018-01-23T09:45:52.216134 #5229]  INFO -- : Celluloid 0.17.3 is running in BACKPORTED mode. [ http://git.io/vJf3J ]
psql:db/structure.sql:100: FEHLER:  Relation »accounts« existiert bereits
rake aborted!
failed to execute:
psql -v ON_ERROR_STOP=1 -q -f db/structure.sql database_name

Please check the output above for any errors and make sure that `psql` is installed in your PATH and has proper permissions.

/home/isaiah/.rbenv/versions/2.4.2/bin/bundle:23:in `load'
/home/isaiah/.rbenv/versions/2.4.2/bin/bundle:23:in `<main>'
Tasks: TOP => db:test:load_structure
(See full trace by running task with --trace)

Because it says the relation "accounts" already exists, which shouldn't happen. Since it's only in db/structure.sql and not in the other schema file.

Unfortunately, I’m unable to reproduce with a fresh app.

No worries, it could be my setup then. I get around that by executing the psql command manually.