41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
|
namespace Weee.Migrations
|
|||
|
{
|
|||
|
using System;
|
|||
|
using System.Data.Entity.Migrations;
|
|||
|
|
|||
|
public partial class addSynergerTables : DbMigration
|
|||
|
{
|
|||
|
public override void Up()
|
|||
|
{
|
|||
|
CreateTable(
|
|||
|
"dbo.SynergerFabs",
|
|||
|
c => new
|
|||
|
{
|
|||
|
fabId = c.Int(nullable: false, identity: true),
|
|||
|
groupId = c.Int(nullable: false),
|
|||
|
})
|
|||
|
.PrimaryKey(t => t.fabId);
|
|||
|
|
|||
|
CreateTable(
|
|||
|
"dbo.SynergerUsers",
|
|||
|
c => new
|
|||
|
{
|
|||
|
userId = c.String(nullable: false, maxLength: 128),
|
|||
|
groupId = c.Int(nullable: false),
|
|||
|
isSelf = c.Boolean(nullable: false),
|
|||
|
})
|
|||
|
.PrimaryKey(t => new { t.userId, t.groupId });
|
|||
|
CreateIndex("dbo.SynergerUsers", "userId", name: "IX_UserId");
|
|||
|
CreateIndex("dbo.SynergerUsers", "groupId", name: "IX_GroupId");
|
|||
|
}
|
|||
|
|
|||
|
public override void Down()
|
|||
|
{
|
|||
|
DropIndex("dbo.SynergerUsers", new[] { "groupId" });
|
|||
|
DropIndex("dbo.SynergerUsers", new[] { "userId" });
|
|||
|
DropTable("dbo.SynergerUsers");
|
|||
|
DropTable("dbo.SynergerFabs");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|