0

What is the best way to dump my development database structure and deploy it to a production server?

Im using capistrano deployment for rails app

  • how would one migrate changes in development database structure automatic with each cap deploy?
2
  • Are you not using migrations? Commented Mar 17, 2012 at 17:35
  • I use migrations but removed them at some points and did a scheme dump Commented Mar 17, 2012 at 17:43

1 Answer 1

1

You can add a migration that executes your schema dump. Then use migrations to make changes after that.

Then, you'll execute cap deploy:migrations to deploy your code and run your migrations.

Sign up to request clarification or add additional context in comments.

3 Comments

how would i add a migration that executres a schema dump? I understand the principe but no idea how to write that thx!
Ok I pasted schema.rb from local machine to schema.rb on production and that seemed to work. The production schema.rb was empty I suspected it to be copied from my local git repo to prod.
Check out rake schema:dump to get it into a file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.