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
developmentandproduction,database_admin, and userake 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