Add migrations
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user