QUEST LOG · March 11, 2019· UPDATED June 2, 2026
Rails Logs: Meet the Three Rake Brothers (for When rake db Goes Wrong)
# Saving yourself when rails db breaks
Run these in order, or run migrate on its own; this is the last-resort fix
The whole procedure is pretty dangerous, so I recommend only doing it during development. The main thing is to keep your attention on the migration.
ruby
rake db:drop #刪除數據庫
rake db:create #新建數據庫
rake db:migrate #更改數據庫(有時可單獨執行)
Never, ever drop the DB in production. You're dead if you do.
Most backend problems show up as schema migration errors. rake won't automatically call migration for the schema when the backend starts, so you have to run it yourself.
Apps I ship
Free on iOS and Android.


