What is the preferred way to manage schema.rb in git?

前端 未结 8 928
醉酒成梦
醉酒成梦 2020-12-01 07:05

I don\'t want to add schema.rb to .gitignore, because I want to be able to load a new database schema from that file. However, keeping it checked

8条回答
  •  星月不相逢
    2020-12-01 07:58

    1. Commit schema.rb file.
    2. Run git pull (or continue with what you're doing)

    Every time you migrate the database, the schema.rb file updates and appears in git status. When working on something and occasionally doing git pull, this can be annoying because you have to commit schema.rb file before pulling to resolve conflict. This means that every time you migrate the database, you need to commit schema.rb file.

提交回复
热议问题