LoginSignup
17
11

More than 5 years have passed since last update.

schema.rbを更新する方法

Last updated at Posted at 2018-02-20

ローカル環境で作業中、モデルを弄ってブラウザを更新してもモデルの更新が反映されない現象に遭遇。

 原因

DBスキーマ(db/schema.rb)の更新が必要。

スキーマの更新方法

rakeで以下のコマンドを実行する。

CLI
$ bundle exec rake db:schema:dump RAILS_ENV=development

参考記事

db/schema.rb は自動更新されない - 独学メモ

17
11
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
17
11