What is seeder and Migration?

Asked

Viewed 1,524 times

4

When it comes to database updating in a project, I always understand the term Migrations being used to keep the bank update among those involved in a particular project.

I’ve also come across the term Seed or seeder when it comes to data entry for testing.

I have little knowledge of such terms, and would like to deepen.

  • What is a Migration?
  • What is a seeder?
  • Seeder and Migration can do the same thing, or are always different things?

1 answer

8


What is a Migration?

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

As Migrations are executed whenever it is necessary to update the bank’s structure or revert the changes to a Migration ancient.

Not necessarily each Migration is an update in the database, the most common way is an update make use of several Migrations.

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

What is a seeder?

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

It is usually used to popular the database with standard data, required for correct operation of the application.

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

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

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

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

  • 1

    Very good explanation. Best impossible +1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.