Does anyone know if Rails can be configured so that rake (e.g. db:migrate) uses a different database user to the app itself?
It seems to me that the database user for the app does not need permissions to drop tables and columns, where as db:migrate does, so separate should make for a more secure app...?
But I assume by default both would use credentials in database.yml
I'm using 2.3.8 with MySQL.
Thanks!
Glen.
You could make a new environment configuration, similar to development
and production
, database_admin
, and use rake db:migrate RAILS_ENV=database_admin
.
If you get tired of typing the extra environment information all the time, you could use the clever rake tasks here to help reduce the tedium: http://errtheblog.com/posts/31-rake-around-the-rosie
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With