Does a capistrano rollback undo migrations?

2019-04-23 14:13发布

I'm new to this. I have a production server and need to deploy the latest version of the application from github, so I'm using Capistrano.

The newest release makes some changes to the database and hence has a bunch of migrations, so I'll be deploying it with deploy:migrate.

So my question was, if I add some data to the new columns created (it doesn't change any of the existing columns in the tables, just creates new tables and columns) and then want to rollback, then will cap deploy:rollback reverse all the migrations as well? Is the data in those new columns erased and the database back to the previous state (assuming I didn't make any data change except to the new additions in the db)?

Thanks!

1条回答
2楼-- · 2019-04-23 14:29

No, it will not. You would need to manually run the down part of those migrations via rake and then roll back.

However, if your current app won't be affected by the new rows it won't hurt anything.

查看更多
登录 后发表回答