What is seeder and migration?

4

When it comes to updating the database in a project, I always realize the term Migrations being used to keep updating the database among those involved in a given project.

I've also come across the term seed or seeder when it comes to entering test data.

I have little knowledge about such terms, and I would like to delve into them.

  • What is a migration ?
  • What is a seeder ?
  • Seeder and Migration can do the same thing, or are they always different things?
asked by anonymous 25.05.2017 / 17:51

1 answer

7
  

What is a migration ?

In this specific context, migration is the definition that is given to managing incremental and reversible changes in database schemas (structure). This allows you to have a "version" control of the database.

migrations are executed whenever you need to update the database structure or roll back the changes to an old migration .

migration is an update to the database, the most common form is an update to make use of migrations .

It is something very used in the development of agile software, where the development of the application is usually done in conjunction with a database that is under construction. Thus, the database structure is being changed in conjunction with development.

  

What is a seeder ?

As the name says, a seeder is a sower. In this specific context it serves to feed the database with data.

Generally it is used to popular the base with data standards, necessary for the correct operation of the application.

For example: you develop an application that can only be accessed by authenticated users; when this publication is published for the first time, the database structure will be created. How can I access the application to create the first user? Well, there are a lot of ways to deal with that, seeder is one of them (great way, in my opinion.

  

Seeder and migration can do the same thing, or are they always different things?

Although related, they have nothing to do. Seeder does one thing, migration does another.

Depending on the / framework tool you are using, a specific migration may contain a specific seeder , but keep in mind that migration updates the database structure, while the seeder serves to popular the database.

    
25.05.2017 / 18:16