문제

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?

도움이 되었습니까?

해결책

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

다른 팁

I agree with Mark on version control: there's no reason not to include your migration scripts.

As for Fabric, I prefer to keep migrations out of it, or at least in a task that is not called implicitly by other tasks. That way errors can't be missed.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top