What's a good way to clean up my migrations in Rails?

后端 未结 4 1522
梦如初夏
梦如初夏 2021-02-04 09:30

So I\'ve been working on this web app for a year now and I would like to compile to schema into ONE migration, that way my text editor loads faster, git working directory isn\'t

4条回答
  •  隐瞒了意图╮
    2021-02-04 09:47

    One way to go is to take a blank database and run all the migrations. Now you've got all the template data which you can save to a yaml. The yaml plus the schema should be enough to bring the DB back without running any of your previously existing migrations.

    However, other answers should mention an existing tool or gem for doing this.

提交回复
热议问题