| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- namespace WePlatform.Migrations
- {
- using System;
- using System.Collections.Generic;
- using System.Data.Entity.Infrastructure.Annotations;
- using System.Data.Entity.Migrations;
-
- public partial class EvalTarget : DbMigration
- {
- public override void Up()
- {
- CreateTable(
- "dbo.EvalTargetInfoes",
- c => new
- {
- Id = c.String(nullable: false, maxLength: 128),
- ParentNo = c.String(maxLength: 128),
- Name = c.String(maxLength: 50),
- Version = c.String(maxLength: 50),
- Description = c.String(maxLength: 500),
- TargetType = c.Int(nullable: false),
- TypePath = c.String(maxLength: 500),
- Remark = c.String(maxLength: 500),
- LastModificationTime = c.DateTime(),
- LastModifierUserId = c.Long(),
- CreationTime = c.DateTime(nullable: false),
- CreatorUserId = c.Long(),
- })
- .PrimaryKey(t => t.Id)
- .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
- .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
- .ForeignKey("dbo.EvalTargetInfoes", t => t.ParentNo)
- .Index(t => t.ParentNo)
- .Index(t => t.LastModifierUserId)
- .Index(t => t.CreatorUserId);
-
- CreateTable(
- "dbo.EvalReportTemplateInfoes",
- c => new
- {
- Id = c.String(nullable: false, maxLength: 128),
- Name = c.String(maxLength: 50),
- Version = c.String(maxLength: 50),
- Description = c.String(maxLength: 500),
- Remark = c.String(maxLength: 500),
- IsDeleted = c.Boolean(nullable: false),
- DeleterUserId = c.Long(),
- DeletionTime = c.DateTime(),
- LastModificationTime = c.DateTime(),
- LastModifierUserId = c.Long(),
- CreationTime = c.DateTime(nullable: false),
- CreatorUserId = c.Long(),
- },
- annotations: new Dictionary<string, object>
- {
- { "DynamicFilter_EvalReportTemplateInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
- })
- .PrimaryKey(t => t.Id)
- .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
- .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
- .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
- .Index(t => t.IsDeleted)
- .Index(t => t.DeleterUserId)
- .Index(t => t.LastModifierUserId)
- .Index(t => t.CreatorUserId);
-
- AddColumn("dbo.WeModel_EvalModels", "QualitativeExpression", c => c.String());
- AddColumn("dbo.WeModel_EvalModels", "EvalTargetNo", c => c.String(maxLength: 128));
- CreateIndex("dbo.WeModel_EvalModels", "EvalTargetNo");
- AddForeignKey("dbo.WeModel_EvalModels", "EvalTargetNo", "dbo.EvalTargetInfoes", "Id");
- }
-
- public override void Down()
- {
- DropForeignKey("dbo.EvalReportTemplateInfoes", "LastModifierUserId", "dbo.Sys_Users");
- DropForeignKey("dbo.EvalReportTemplateInfoes", "DeleterUserId", "dbo.Sys_Users");
- DropForeignKey("dbo.EvalReportTemplateInfoes", "CreatorUserId", "dbo.Sys_Users");
- DropForeignKey("dbo.WeModel_EvalModels", "EvalTargetNo", "dbo.EvalTargetInfoes");
- DropForeignKey("dbo.EvalTargetInfoes", "ParentNo", "dbo.EvalTargetInfoes");
- DropForeignKey("dbo.EvalTargetInfoes", "LastModifierUserId", "dbo.Sys_Users");
- DropForeignKey("dbo.EvalTargetInfoes", "CreatorUserId", "dbo.Sys_Users");
- DropIndex("dbo.EvalReportTemplateInfoes", new[] { "CreatorUserId" });
- DropIndex("dbo.EvalReportTemplateInfoes", new[] { "LastModifierUserId" });
- DropIndex("dbo.EvalReportTemplateInfoes", new[] { "DeleterUserId" });
- DropIndex("dbo.EvalReportTemplateInfoes", new[] { "IsDeleted" });
- DropIndex("dbo.EvalTargetInfoes", new[] { "CreatorUserId" });
- DropIndex("dbo.EvalTargetInfoes", new[] { "LastModifierUserId" });
- DropIndex("dbo.EvalTargetInfoes", new[] { "ParentNo" });
- DropIndex("dbo.WeModel_EvalModels", new[] { "EvalTargetNo" });
- DropColumn("dbo.WeModel_EvalModels", "EvalTargetNo");
- DropColumn("dbo.WeModel_EvalModels", "QualitativeExpression");
- DropTable("dbo.EvalReportTemplateInfoes",
- removedAnnotations: new Dictionary<string, object>
- {
- { "DynamicFilter_EvalReportTemplateInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
- });
- DropTable("dbo.EvalTargetInfoes");
- }
- }
- }
|