Rails: Best way to make changes to a production database

后端 未结 4 1568
滥情空心
滥情空心 2021-02-01 10:10

I need to make changes to an in-use production database. Just adding a few columns. I\'ve made the changes to the dev database with migrations. What is the best way to update

4条回答
  •  春和景丽
    2021-02-01 10:32

    I always follow this procedure:

    • Dump prod database with mysqldump command
    • Populate dev / test database with dump using mysql command
    • Run migrations in dev / test
    • Check migration worked
    • Dump prod database with mysqldump command (as it may have changed) keeping backup on server
    • Run migrations on prod (using capristano)
    • Test migration has worked on prod
    • Drink beer (while watching error logs)

提交回复
热议问题