demo20230512/Migrations/202211171502432_addSynergerTables.cs

41 lines
1.3 KiB
C#
Raw Normal View History

2023-05-12 10:20:28 +08:00
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");
}
}
}