Openbanana is a gem that, currently, provides a
db:grant rake task for Rails
db:grant task does is creates the database and sets up the initial grants for the database
configured in the
To use Openbanana, include it in your
And in your
DB_USERoverrides the default user (root) to grant privileges
DB_PASSWORDoverrides the default password (empty) to grant privileges
DB_HOSToverrides the hostname for the database server (defaults to localhost)
For sharded configurations using a shards.yml file (such as using the octopus gem,
see https://github.com/tchandy/octopus) or with extra sharded entries in database.yml
(named production or development, etc.; such as using the data_fabric gem,
see https://github.com/bpot/data_fabric), adds a
db:grant_shards task to create
and grant for a set of shard databases.
An example shard.yml looks like:
octopus: ... production: ungrouped_shard: adapter: mysql2 database: foo .... also specify username, password, host, etc. shard_group: shard1: database: bar_1 .... shard2: database: bar_2 .... ...
or entries in database.yml that look like:
... shard_1_production: adapter: mysql2 database: foo_prod_s1 .. etc. shard_2_production: ...