Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rake db:migrate fails to run on first deploy #191

Closed
nathanvda opened this issue May 12, 2014 · 2 comments
Closed

rake db:migrate fails to run on first deploy #191

nathanvda opened this issue May 12, 2014 · 2 comments

Comments

@nathanvda
Copy link

Hi, I am trying to do my first deploy with mina, and it fails to run the migrations.

This is normal: my migrations do not run from the start, because somewhere during development I added the schema_plus gem, which makes my migrations more stringent.

Normally this is not a problem: I would just do rake db:setup and I would be fine and dandy. However: after a failed install, everything is deleted, so I cannot do a manual rake db:setup.

Does anybody have some tips how to get out of this?

So, either

  • a way to run rake db:setup on first deploy
  • or a way that the files are not deleted after a failed install, so I can still manually run rake db:setup
@mbajur
Copy link

mbajur commented May 12, 2014

I had a similar issue some time ago (where i wanted to run a rake task but
installation was failing so i wasn't able to). I have manually cloned my
repo on a server, configured my db, fired rake db:setup and removed
cloned repo. Then, i have made a regular deploy with mina on previously
used database.

Kind of ugly but it works :)

@nathanvda
Copy link
Author

Ok. Thanks for the tip. I did something alike. I added

    to :clean do
      queue %[echo "do my personal cleaning"]
      queue %[cp -R "$build_path" "#{deploy_to}/keep_failed"]
    end

so right before cleaning, it would copy the build folder to the keep_failed folder, and then I could use that to run rake db:setup. Still dirty, but a little less work 💤 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants