Update password field in db, set null for uninitialized

This commit is contained in:
2013-02-12 20:22:49 -05:00
parent e2498b5270
commit 709ec249a2
8 changed files with 83 additions and 15 deletions
@@ -0,0 +1,20 @@
namespace MileageTraker.Web.Migrations
{
using System.Data.Entity.Migrations;
public partial class PasswordNullForUninitialized : DbMigration
{
public override void Up()
{
AlterColumn("User", "Password", c => c.String(maxLength: 128));
Sql(@"update [User]
set Password = null
where Password = 'uninitialized_state'");
}
public override void Down()
{
AlterColumn("User", "Password", c => c.String(nullable: false, maxLength: 128));
}
}
}