126 lines
5.8 KiB
C#
126 lines
5.8 KiB
C#
|
namespace Weee.Migrations
|
|||
|
{
|
|||
|
using System;
|
|||
|
using System.Data.Entity.Migrations;
|
|||
|
|
|||
|
public partial class reAddAdminAccessTables : DbMigration
|
|||
|
{
|
|||
|
public override void Up()
|
|||
|
{
|
|||
|
CreateTable(
|
|||
|
"dbo.AdminAccesses",
|
|||
|
c => new
|
|||
|
{
|
|||
|
ID = c.Int(nullable: false, identity: true),
|
|||
|
encryptedJson = c.String(),
|
|||
|
encJsonAppliedBy = c.String(),
|
|||
|
encJsonAppliedtime = c.DateTime(nullable: false),
|
|||
|
functionScope = c.Int(nullable: false),
|
|||
|
activeStartDate = c.DateTime(),
|
|||
|
activeEndDate = c.DateTime(),
|
|||
|
companyAdminLimit = c.Int(nullable: false),
|
|||
|
lcaLimit = c.Int(nullable: false),
|
|||
|
listReportLimit = c.Int(nullable: false),
|
|||
|
certifyCompanyLimit = c.Int(nullable: false),
|
|||
|
lcaUserLimit = c.Int(nullable: false),
|
|||
|
supplierLimit = c.Int(nullable: false),
|
|||
|
rowHash = c.String(),
|
|||
|
})
|
|||
|
.PrimaryKey(t => t.ID);
|
|||
|
|
|||
|
CreateTable(
|
|||
|
"dbo.AdminAccessHistories",
|
|||
|
c => new
|
|||
|
{
|
|||
|
historyID = c.Int(nullable: false, identity: true),
|
|||
|
ID = c.Int(nullable: false),
|
|||
|
encryptedJson = c.String(),
|
|||
|
encJsonAppliedBy = c.String(),
|
|||
|
encJsonAppliedtime = c.DateTime(nullable: false),
|
|||
|
functionScope = c.Int(nullable: false),
|
|||
|
activeStartDate = c.DateTime(),
|
|||
|
activeEndDate = c.DateTime(),
|
|||
|
companyAdminLimit = c.Int(nullable: false),
|
|||
|
lcaLimit = c.Int(nullable: false),
|
|||
|
listReportLimit = c.Int(nullable: false),
|
|||
|
certifyCompanyLimit = c.Int(nullable: false),
|
|||
|
lcaUserLimit = c.Int(nullable: false),
|
|||
|
supplierLimit = c.Int(nullable: false),
|
|||
|
rowHash = c.String(),
|
|||
|
})
|
|||
|
.PrimaryKey(t => t.historyID);
|
|||
|
|
|||
|
CreateTable(
|
|||
|
"dbo.AdminAccessUsages",
|
|||
|
c => new
|
|||
|
{
|
|||
|
ID = c.Int(nullable: false, identity: true),
|
|||
|
lastModifiedtime = c.DateTime(nullable: false),
|
|||
|
companyAdminQuantity = c.Int(nullable: false),
|
|||
|
lcaQuantity = c.Int(nullable: false),
|
|||
|
listReportQuantity = c.Int(nullable: false),
|
|||
|
certifyCompanyQuantity = c.Int(nullable: false),
|
|||
|
lcaUserQuantity = c.Int(nullable: false),
|
|||
|
supplierQuantity = c.Int(nullable: false),
|
|||
|
})
|
|||
|
.PrimaryKey(t => t.ID);
|
|||
|
|
|||
|
CreateTable(
|
|||
|
"dbo.UserAccountAccesses",
|
|||
|
c => new
|
|||
|
{
|
|||
|
ID = c.Int(nullable: false, identity: true),
|
|||
|
UserId = c.String(nullable: false, maxLength: 128),
|
|||
|
lastModifiedBy = c.String(),
|
|||
|
lastModifiedTime = c.DateTime(nullable: false),
|
|||
|
lcaLimit = c.Int(nullable: false),
|
|||
|
allow3456 = c.Boolean(nullable: false),
|
|||
|
supplierAccountLimit = c.Int(nullable: false),
|
|||
|
fabLimit = c.Int(nullable: false),
|
|||
|
allowMergeReport = c.Boolean(nullable: false),
|
|||
|
functionScope = c.Int(nullable: false),
|
|||
|
activeStartDate = c.DateTime(),
|
|||
|
activeEndDate = c.DateTime(),
|
|||
|
listReportLimit = c.Int(nullable: false),
|
|||
|
lcaUserLimit = c.Int(nullable: false),
|
|||
|
supplierLimit = c.Int(nullable: false),
|
|||
|
})
|
|||
|
.PrimaryKey(t => t.ID);
|
|||
|
CreateIndex("dbo.UserAccountAccesses", "UserId", name: "IX_UserId");
|
|||
|
|
|||
|
CreateTable(
|
|||
|
"dbo.UserAccountAccessHistories",
|
|||
|
c => new
|
|||
|
{
|
|||
|
historyID = c.Int(nullable: false, identity: true),
|
|||
|
ID = c.Int(nullable: false),
|
|||
|
UserId = c.String(nullable: false, maxLength: 128),
|
|||
|
lastModifiedBy = c.String(),
|
|||
|
lastModifiedTime = c.DateTime(nullable: false),
|
|||
|
lcaLimit = c.Int(nullable: false),
|
|||
|
allow3456 = c.Boolean(nullable: false),
|
|||
|
supplierAccountLimit = c.Int(nullable: false),
|
|||
|
fabLimit = c.Int(nullable: false),
|
|||
|
allowMergeReport = c.Boolean(nullable: false),
|
|||
|
functionScope = c.Int(nullable: false),
|
|||
|
activeStartDate = c.DateTime(),
|
|||
|
activeEndDate = c.DateTime(),
|
|||
|
listReportLimit = c.Int(nullable: false),
|
|||
|
lcaUserLimit = c.Int(nullable: false),
|
|||
|
supplierLimit = c.Int(nullable: false),
|
|||
|
})
|
|||
|
.PrimaryKey(t => t.historyID);
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
public override void Down()
|
|||
|
{
|
|||
|
DropTable("dbo.UserAccountAccessHistories");
|
|||
|
DropTable("dbo.UserAccountAccesses");
|
|||
|
DropTable("dbo.AdminAccessUsages");
|
|||
|
DropTable("dbo.AdminAccessHistories");
|
|||
|
DropTable("dbo.AdminAccesses");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|