22 lines
657 B
C#
22 lines
657 B
C#
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");
|
|
}
|
|
}
|
|
}
|