Do you know the best tools for Database Schema Update?
31/07/2019 12:05 PM by
It is important when deploying your database for the database to be updated automatically.
There are a number of tools that can be used to update the database as the application can be updated.
Legacy full framework
SQL Deploy (This is the suggested tool if you are not using Entity Framework Code First)
- DBUp +
Bad options for updating database schema - No ability to validate that the database hasn't been tampered with
- SQL Management Studio + OSQL (Free and roll your own)
- Visual Studio 2017 + SQL Server Data Tools (Formerly Data Dude) + Deploy (post-development model)
- Red Gate SQL Compare + Red Gate SQL Packager (post-development model)
- Figure: Don't use Data Dude
public partial class GenderToString : DbMigrationGood Example - Data motion with EF Migrations
public override void Up()
AddColumn("dbo.Customers", "GenderTemp", c => c.Boolean(nullable: false));
Sql("UPDATE [dbo].[Customers] set GenderTemp = Gender");
AddColumn("dbo.Customers", "Gender", c => c.String(maxLength: 2));
Sql("UPDATE [dbo].[Customers] set Gender = 'M' where GenderTemp=1");
Sql("UPDATE [dbo].[Customers] set Gender = 'F' where GenderTemp=0");
Do you feel this rule needs an update?