What are Rails migrations?

Updated May 24, 2026

Short answer

Migrations are version-controlled database schema changes.

Deep explanation

They allow evolving database structure safely over time using Ruby scripts tracked in version control.

Real-world example

Adding new fields like 'phone number' to users table in production apps.

Common mistakes

  • Editing old migrations instead of creating new ones.

Follow-up questions

  • How to rollback migrations?
  • What is schema.rb?

More Ruby on Rails interview questions

View all →