You are here: Browse Railsplugins Migration With Admin
= MigrationWithAdmin
Rails Migrations uses connection settings in config/database.yml – which usually is set for application-level access
To execute super-user database commands, normally we would have a few options 1) Edit config/database.yml to use admin connection 2) Add a new connection (e.g. migration) into config/database.yml and execute RAILS_ENV=migration rake db:migrate 3) Execute the commands as admin manually, outside of Rails Migration
If the above options doesn’t suit your scenario, with this plugin you have 4) Prompt for admin username and password when required
DetailsCurrently, when execute() fails with (yea, MySQL specific currently) "Access denied; you need the SUPER privilege for this operation" Migrations will prompt for admin username and password and retry execution Once admin connection has been established and used, it will be continued to be used until the end of run.
The password will not echo if termios is installed.
LicenseMigrationWithAdmin is released under the MIT license.
== Author
Chew Choon Keat <choonkeat gmail at> http://blog.yanime.org/
5 March 2007
NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly