LoginSignup
0
0

More than 1 year has passed since last update.

AWS ECS の production 環境に rails db:migrate する手軽な方法

Posted at

RDSにはlocalから直接接続できるようにしておく
database.yaml などで必要な接続設定をしたらlocalからでも直接migrateを実行してしまえば良い

あくまで手軽な方法なので本番運用ではちゃんとやること
(ちゃんとの中身はまだ分からないのだが)

コマンド例

RAILS_ENV=production rails db:create
RAILS_ENV=production rails db:migrate

database.yaml の例

default: &default
  adapter: mysql2
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  timeout: 5000

production:
  <<: *default
  host: *****.ap-northeast-1.rds.amazonaws.com
  username: username
  database: databasename
  password: password


チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0