Commit eb141795 by liyijie

feat: 更新mongoid的相关配置

parent 85e3f0cc
......@@ -14,3 +14,9 @@ S3_REGION = cn-east-2
S3_BUCKET = soa-storage
S3_ENDPOINT = https://obs.cn-east-2.myhuaweicloud.com
S3_PUBLIC = true
MONGO_DB_NAME = rails_mongo_record
MONGO_DB_HOSTS = 'localhost:27017'
MONGO_DB_POOL = 1
MONGO_DB_USERNAME =
MONGO_DB_PASSWORD =
development:
clients:
default:
database: <%= ENV["MONGO_DB_NAME"] %>
hosts: <%= ENV["MONGO_DB_HOSTS"].split(',') %>
options:
user: <%= ENV["MONGO_DB_USERNAME"] %>
password: <%= ENV["MONGO_DB_PASSWORD"] %>
options:
test:
clients:
default:
database: <%= ENV["MONGO_DB_NAME"] %>
hosts: <%= ENV["MONGO_DB_HOSTS"].split(',') %>
options:
user: <%= ENV["MONGO_DB_USERNAME"] %>
password: <%= ENV["MONGO_DB_PASSWORD"] %>
read:
mode: :primary
max_pool_size: <%= ENV["MONGO_DB_POOL"] %>
production:
clients:
default:
database: <%= ENV["MONGO_DB_NAME"] %>
hosts: <%= ENV["MONGO_DB_HOSTS"].split(',') %>
options:
user: <%= ENV["MONGO_DB_USERNAME"] %>
password: <%= ENV["MONGO_DB_PASSWORD"] %>
read:
mode: :primary
max_pool_size: <%= ENV["MONGO_DB_POOL"] %>
......@@ -121,6 +121,8 @@ after_bundle do
copy_file 'src/config/puma.rb', 'config/puma.rb'
remove_file 'config/database.yml'
copy_file 'src/config/database.yml', 'config/database.yml'
remove_file 'config/mongoid.yml'
copy_file 'src/config/mongoid.yml', 'config/mongoid.yml'
remove_file 'config/storage.yml'
copy_file 'src/config/storage.yml', 'config/storage.yml'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment