I need to configure my application to use multiple shards and even multiple db adapters. I noticed that all rake commands, such as rake db:migrate, work and have consequences for shards defined in shards.yml, except rake db:create. It will be a real pain to create it all manually. How can I make it work?
My .yml database (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:
environments:
- 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:
....
Only db from the .yml database are created using rake-task rake db:create.
source
share