ruby - Rails with Octopus gem. How to create db's defined in shards.yml with rake -
I need to configure my app to use several shards, and even many DB adapters I have seen that all rake commands like rake db: create
. It will be a real pain to make all manually. How can i work it
My database. IML (I defined here, only my master shard)
Development: Adapter: PostgreSQL host: Localhost encoding: Unicode database: db_workload_master_development pool: 5 Username: Password: Production: ......
My shards.yml
Octopus: environment: - Production - Development development: shards : Mysql: host: localhost adapter: mysql2 database: db_workload_mysql_shard_development sqlite: host: localhost adapter: sqlite3 database: db_workload_sqlite_shard_development pg: host: localhost adapter: postgresql database: Db_workload_pg_shard_development pool: 5 Username: Password: Production: ....
From database.yml, only the DB can get the rake-work Rack db:
.
I recommend creating my own rake work which is shards.yml Will read and make DB in the proper form.
Comments
Post a Comment