Do you know the best tools for Database Schema Update?
11/09/2020 6:15 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
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 + 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?