Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I keep DB migration scripts generated via alembic under version control

I am using SQLAlchemy and PostgreSQL on my live site. For database migrations, I am using alembic. I have some questions regarding the best strategy to do this .

  1. Do I need to keep my DB migration scripts under version control?

  2. I use Fabric for automated deployments. Should I run migration scripts by hand or I can make it automated?

like image 214
codecool Avatar asked Dec 11 '12 11:12

codecool


1 Answers

If you ever expect to use your DB migration scripts again -- yes, keep them under version control. (It sometimes helps with debugging/forensics too.)

like image 104
Mark Leighton Fisher Avatar answered Oct 27 '22 19:10

Mark Leighton Fisher