Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "migration" mean in Programming?

I'm learning Ruby on Rails and it talk about how Migration changes the state of the database by using the command bundle exec rake db:migrate, but what exactly does that mean?

like image 945
narulakeshav Avatar asked Oct 25 '25 11:10

narulakeshav


1 Answers

Migrations are a way of defining the schema of your database. Rails provides an API for adding/dropping/modifying database columns and tables using Ruby code. These files are knows as migrations. Here is a link to the documentation: http://edgeguides.rubyonrails.org/active_record_migrations.html, but migrations are not a concept unique to Rails. For example, Django also uses migrations to manage the state of the database. The short answer is that migrations are a code-based way to manage the structure, or schema of your database.

like image 156
NM Pennypacker Avatar answered Oct 28 '25 02:10

NM Pennypacker