namespace ContractService.Migrations { using System; using System.Collections.Generic; using System.Data.Entity.Infrastructure.Annotations; using System.Data.Entity.Migrations; public partial class Update20210320001 : DbMigration { public override void Up() { AlterTableAnnotations( "dbo.Ls_LegalContractKeyPoints", c => new { Id = c.String(nullable: false, maxLength: 128), ParentNo = c.String(maxLength: 128), Name = c.String(maxLength: 50), Tags = c.String(maxLength: 200), Description = c.String(maxLength: 500), KeyPointLevel = c.Int(nullable: false), KeyPointState = c.Int(nullable: false), ExpireDate = c.DateTime(), AlarmDate = c.DateTime(), ExecuteDate = c.DateTime(), ExpireDay = c.Int(nullable: false), AlarmDay = c.Int(nullable: false), KeyPointPath = c.String(maxLength: 500), ContractNo = c.String(maxLength: 128), Remark = c.String(maxLength: 1000), NotifyType = c.Int(nullable: false), 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 { { "DynamicFilter_LegalContractKeyPointInfo_SoftDelete", new AnnotationValues(oldValue: null, newValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition") }, }); AddColumn("dbo.Ls_LegalContractKeyPoints", "IsDeleted", c => c.Boolean(nullable: false)); AddColumn("dbo.Ls_LegalContractKeyPoints", "DeleterUserId", c => c.Long()); AddColumn("dbo.Ls_LegalContractKeyPoints", "DeletionTime", c => c.DateTime()); CreateIndex("dbo.Ls_LegalContractKeyPoints", "IsDeleted"); CreateIndex("dbo.Ls_LegalContractKeyPoints", "DeleterUserId"); AddForeignKey("dbo.Ls_LegalContractKeyPoints", "DeleterUserId", "dbo.Sys_Users", "Id"); } public override void Down() { DropForeignKey("dbo.Ls_LegalContractKeyPoints", "DeleterUserId", "dbo.Sys_Users"); DropIndex("dbo.Ls_LegalContractKeyPoints", new[] { "DeleterUserId" }); DropIndex("dbo.Ls_LegalContractKeyPoints", new[] { "IsDeleted" }); DropColumn("dbo.Ls_LegalContractKeyPoints", "DeletionTime"); DropColumn("dbo.Ls_LegalContractKeyPoints", "DeleterUserId"); DropColumn("dbo.Ls_LegalContractKeyPoints", "IsDeleted"); AlterTableAnnotations( "dbo.Ls_LegalContractKeyPoints", c => new { Id = c.String(nullable: false, maxLength: 128), ParentNo = c.String(maxLength: 128), Name = c.String(maxLength: 50), Tags = c.String(maxLength: 200), Description = c.String(maxLength: 500), KeyPointLevel = c.Int(nullable: false), KeyPointState = c.Int(nullable: false), ExpireDate = c.DateTime(), AlarmDate = c.DateTime(), ExecuteDate = c.DateTime(), ExpireDay = c.Int(nullable: false), AlarmDay = c.Int(nullable: false), KeyPointPath = c.String(maxLength: 500), ContractNo = c.String(maxLength: 128), Remark = c.String(maxLength: 1000), NotifyType = c.Int(nullable: false), 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 { { "DynamicFilter_LegalContractKeyPointInfo_SoftDelete", new AnnotationValues(oldValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition", newValue: null) }, }); } } }