capistrano / rails

Official Ruby on Rails specific tasks for Capistrano
http://www.capistranorb.com/
MIT License
867 stars 270 forks source link

diff schema.rb instead of migrations directory #183

Closed ghost closed 8 years ago

ghost commented 8 years ago

I have a project that dynamically includes migrations from rails engine(s). The engine migration files aren't in db/migrate, so diffing that directory wasn't catching changes to my database.

It may be a better idea to just diff the whole db directory, but the simplest change for my use-case was to just diff the schema.rb.

There aren't any tests so ¯(°_o)/¯

will-in-wi commented 8 years ago

This seems reasonable. Schema.rb should be capturing the changes no matter what.

On a side-note, I thought engine migrations were used with the rake your_engine_name:install:migrations task to copy them into the app dir…

ghost commented 8 years ago

That's the default behavior; but, this particular project is using something like https://blog.pivotal.io/labs/labs/leave-your-migrations-in-your-rails-engines to keep the migrations inside the engines.

mattbrictson commented 8 years ago

Yes, this looks good. Thanks! Can you add a CHANGELOG entry under the Your contribution here! bullet?

mattbrictson commented 8 years ago

Hmm, on second thought, this would not work if a project is using structure.sql instead of schema.rb. I would prefer a PR that compares the whole db directory; that would be a safer and more comprehensive approach.

ghost commented 7 years ago

Sorry about the delay, I got distracted by other things. New PR opened.