Can I specify in database.yml that a rails environment should have readonly access to the DB? -
we have app pretty standard database configuration. on live servers, if want query contents of database have run script/console production
or script/dbconsole production
, risk accidentally modifying our data. create new rails environment readonly access same database, can run script/console readonly
or script/dbconsole readonly
without risk. i've seen solutions involve adding new mysql user, or monkey patching activerecord::base. don't want - want specify in database.yml connection database should readonly. possible, , if so, how do it? i've tried adding readonly: true
it's ignored.
you can use console in sandbox mode. in sandbox mode, database changes made while in console reverted when exit console.
$ script/console --sandbox
you can't specify readonly mode in database.yml
.
Comments
Post a Comment