有時候手動操作 database 刪掉了 table,於是乎 rails migration 跟 database 就對不起來了,要怎麼樣騙 rails 說上一個 create table 的 migration file 沒跑過呢?how does rails track this?
Ans: Rails 存了一個 schema_migrations 的 table 在database 裡面,只要把相對應的 record 刪掉就行了,easy peasy
https://stackoverflow.com/questions/12057408/how-does-rails-keep-track-of-which-migrations-have-run-for-a-database
沒有留言:
張貼留言