Skip to main content

How do you perform database migrations?

Senior Python
Quick Answer Django migrations: python manage.py makemigrations (generates migration files from model changes), python manage.py migrate (applies to DB). Migrations track schema changes in version control. SQLAlchemy uses Alembic for migrations: alembic revision --autogenerate, alembic upgrade head. Always review auto-generated migrations before applying. Back up production DB before running migrations.

Answer

Migrations track schema changes.
Auto-generated scripts modify tables and fields.
Keep environments consistent across dev, staging, and production.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice