namespace LeafWeb.Core.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class LeafInputUniqueToken : DbMigration
    {
        public override void Up()
        {
            AddColumn("dbo.LeafInput", "UniqueToken", c => c.String(nullable: false, maxLength: 12, unicode: false));
			Sql(@"UPDATE dbo.LeafInput SET UniqueToken = Id");
            CreateIndex("dbo.LeafInput", "UniqueToken", unique: true);
        }
        
        public override void Down()
        {
            DropIndex("dbo.LeafInput", new[] { "UniqueToken" });
            DropColumn("dbo.LeafInput", "UniqueToken");
        }
    }
}
