1

I want to know a tool to use for SQL Server Database migrations and why as of 2017, since I worry about this topic, so I can automate this process as much as possible.

What do you think about Entity Framework Code First Migrations, assuming I'm using .Net?

1

There are two main products that I'm aware of in the relatively new field of database migration.

Flyway

Flyway is basically a tool to organize, track, and automatically apply a collection of SQL scripts you write.

Can be used from within Java app, and from the command-line for non-Java environments.

Free of cost. Open source.

Liquibase

Liquibase is a competitor to Flyway, serving the same purpose.

  • Flyway is good, but it doesn't generate the migration scripts, while Entity Framework Code First Migrations do. – Miguel Domingos Apr 22 '17 at 14:45
  • 1
    @MiguelDomingos There are no diff tools that I know of that can do a perfect 100% job of writing scripts to recreate the entirety of a complex database. The only perfect approach is to write all of your database creation and modification in SQL scripts that you then collect and apply through a tool like Flyway exclusively. – Basil Bourque Apr 22 '17 at 15:23
  • .@BasilBourque Entity Framework can scaffold all migrations with accuracy because there is a model made of classes in C# and that model is keept in sync with the database. Since Flyway doesn't know anything about the application classes, with Flyway you have to write your own migration scripts from the scratch. – Miguel Domingos Apr 22 '17 at 15:51
  • @MiguelDomingos There is more to a database than the entity tables. But good luck to you. – Basil Bourque Apr 22 '17 at 16:28
  • .@BasilBourque The entity tables are an important part of a database and at least it's better to generate that than nothing. – Miguel Domingos Apr 22 '17 at 17:32
0

I would check out dbatools.io

They have powershell scripts that can do exactly what you need. And it's free.

  • Any update / feedback on my answer? – Matt McDonald Apr 29 '17 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.