We have lots of database migration files - should we keep them?

前端 未结 2 1279
逝去的感伤
逝去的感伤 2021-02-08 20:58

We have around 100 database migration files. Many of them make schema changes which are irreversible. There are also later migrations which change or remove tables which were cr

2条回答
  •  清歌不尽
    2021-02-08 21:02

    Yes, what you're proposing is considered a best practice.

    I've done this with my old apps several times. You'll want to back your migrations up somewhere until you're satisfied all is well, of course, this is an important part of application maintenance - if you have a lot of old migrations, it can take forever to do a db:reset or to get a new development environment running.

提交回复
热议问题