diff --git a/samples/web/Liuliu.Demo.WebApi/Liuliu.Demo.WebApi.csproj b/samples/web/Liuliu.Demo.WebApi/Liuliu.Demo.WebApi.csproj index ec8ec8ae..05c930d4 100644 --- a/samples/web/Liuliu.Demo.WebApi/Liuliu.Demo.WebApi.csproj +++ b/samples/web/Liuliu.Demo.WebApi/Liuliu.Demo.WebApi.csproj @@ -4,7 +4,7 @@ - net6.0 + net7.0 Liuliu.Demo.Web 38c51dba-31f4-4c29-a3b3-49164e38d32f Linux diff --git a/samples/web/Liuliu.Demo.WebApi/Migrations/20231006102753_Comment.Designer.cs b/samples/web/Liuliu.Demo.WebApi/Migrations/20231006102753_Comment.Designer.cs new file mode 100644 index 00000000..3cf9310f --- /dev/null +++ b/samples/web/Liuliu.Demo.WebApi/Migrations/20231006102753_Comment.Designer.cs @@ -0,0 +1,1620 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using OSharp.Entity; + +#nullable disable + +namespace Liuliu.Demo.Web.Migrations +{ + [DbContext(typeof(DefaultDbContext))] + [Migration("20231006102753_Comment")] + partial class Comment + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.11") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("OSharp.Authorization.EntityInfos.EntityInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("AuditEnabled") + .HasColumnType("bit") + .HasComment("是否数据审计"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("实体名称"); + + b.Property("PropertyJson") + .IsRequired() + .HasMaxLength(5000) + .HasColumnType("nvarchar(max)") + .HasComment("实体属性信息Json字符串"); + + b.Property("TypeName") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("实体类型名称"); + + b.HasKey("Id"); + + b.HasIndex("TypeName") + .IsUnique() + .HasDatabaseName("ClassFullNameIndex"); + + b.ToTable("Auth_EntityInfo", (string)null); + }); + + modelBuilder.Entity("OSharp.Authorization.Functions.Function", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("AccessType") + .HasColumnType("int") + .HasComment("访问类型"); + + b.Property("Action") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("功能"); + + b.Property("Area") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("区域"); + + b.Property("AuditEntityEnabled") + .HasColumnType("bit") + .HasComment("是否数据审计"); + + b.Property("AuditOperationEnabled") + .HasColumnType("bit") + .HasComment("是否操作审计"); + + b.Property("CacheExpirationSeconds") + .HasColumnType("int") + .HasComment("数据缓存秒数"); + + b.Property("Controller") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("控制器"); + + b.Property("IsAccessTypeChanged") + .HasColumnType("bit") + .HasComment("访问类型是否更改"); + + b.Property("IsAjax") + .HasColumnType("bit") + .HasComment("是否Ajax功能"); + + b.Property("IsCacheSliding") + .HasColumnType("bit") + .HasComment("是否相对过期时间"); + + b.Property("IsController") + .HasColumnType("bit") + .HasComment("是否控制器"); + + b.Property("IsLocked") + .HasColumnType("bit") + .HasComment("是否锁定"); + + b.Property("IsSlaveDatabase") + .HasColumnType("bit") + .HasComment("是否从库"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("名称"); + + b.HasKey("Id"); + + b.HasIndex("Area", "Controller", "Action") + .IsUnique() + .HasDatabaseName("AreaControllerActionIndex") + .HasFilter("[Area] IS NOT NULL AND [Controller] IS NOT NULL AND [Action] IS NOT NULL"); + + b.ToTable("Auth_Function", (string)null); + }); + + modelBuilder.Entity("OSharp.Core.Systems.KeyValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("Display") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)") + .HasComment("显示名称"); + + b.Property("IsLocked") + .HasColumnType("bit") + .HasComment("是否锁定"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasComment("数据键名"); + + b.Property("Order") + .HasColumnType("int") + .HasComment("Order"); + + b.Property("Remark") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)") + .HasComment("显示名称"); + + b.Property("ValueJson") + .HasColumnType("text") + .HasComment("数据值JSON"); + + b.Property("ValueType") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)") + .HasComment("数据值类型名"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique() + .HasDatabaseName("KeyIndex"); + + b.ToTable("Systems_KeyValue", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.EntityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("CreatedTime") + .HasColumnType("datetime2") + .HasComment("创建时间"); + + b.Property("EntityId") + .HasColumnType("uniqueidentifier") + .HasComment("数据编号"); + + b.Property("FilterGroupJson") + .HasMaxLength(5000) + .HasColumnType("nvarchar(max)") + .HasComment("过滤条件组Json字符串"); + + b.Property("IsLocked") + .HasColumnType("bit") + .HasComment("是否锁定"); + + b.Property("Operation") + .HasColumnType("int") + .HasComment("数据权限操作"); + + b.Property("RoleId") + .HasColumnType("int") + .HasComment("角色编号"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("EntityId", "RoleId", "Operation") + .IsUnique() + .HasDatabaseName("EntityRoleIndex"); + + b.ToTable("Auth_EntityRole", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.EntityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("CreatedTime") + .HasColumnType("datetime2") + .HasComment("创建时间"); + + b.Property("EntityId") + .HasColumnType("uniqueidentifier") + .HasComment("数据编号"); + + b.Property("FilterGroupJson") + .HasMaxLength(5000) + .HasColumnType("nvarchar(max)") + .HasComment("过滤条件组Json字符串"); + + b.Property("IsLocked") + .HasColumnType("bit") + .HasComment("是否锁定"); + + b.Property("UserId") + .HasColumnType("int") + .HasComment("用户编号"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("EntityId", "UserId") + .HasDatabaseName("EntityUserIndex"); + + b.ToTable("Auth_EntityUser", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.Module", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("编号"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Code") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("模块代码"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("模块名称"); + + b.Property("OrderCode") + .HasColumnType("float") + .HasComment("排序码"); + + b.Property("ParentId") + .HasColumnType("int") + .HasComment("父模块编号"); + + b.Property("Remark") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("模块描述"); + + b.Property("TreePathString") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)") + .HasComment("父节点树形路径"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.ToTable("Auth_Module", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.ModuleFunction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("FunctionId") + .HasColumnType("uniqueidentifier") + .HasComment("功能编号"); + + b.Property("ModuleId") + .HasColumnType("int") + .HasComment("模块编号"); + + b.HasKey("Id"); + + b.HasIndex("FunctionId"); + + b.HasIndex("ModuleId", "FunctionId") + .IsUnique() + .HasDatabaseName("ModuleFunctionIndex"); + + b.ToTable("Auth_ModuleFunction", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.ModuleRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("ModuleId") + .HasColumnType("int") + .HasComment("模块编号"); + + b.Property("RoleId") + .HasColumnType("int") + .HasComment("角色编号"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("ModuleId", "RoleId") + .IsUnique() + .HasDatabaseName("ModuleRoleIndex"); + + b.ToTable("Auth_ModuleRole", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.ModuleUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("Disabled") + .HasColumnType("bit") + .HasComment("Disabled"); + + b.Property("ModuleId") + .HasColumnType("int") + .HasComment("模块编号"); + + b.Property("UserId") + .HasColumnType("int") + .HasComment("用户编号"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("ModuleId", "UserId") + .IsUnique() + .HasDatabaseName("ModuleUserIndex"); + + b.ToTable("Auth_ModuleUser", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.LoginLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("CreatedTime") + .HasColumnType("datetime2") + .HasComment("创建时间"); + + b.Property("Ip") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasComment("登录IP"); + + b.Property("LogoutTime") + .HasColumnType("datetime2") + .HasComment("退出时间"); + + b.Property("UserAgent") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("用户代理头"); + + b.Property("UserId") + .HasColumnType("int") + .HasComment("用户编号"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Identity_LoginLog", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.Organization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("编号"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("名称"); + + b.Property("ParentId") + .HasColumnType("int") + .HasComment("父组织机构编号"); + + b.Property("Remark") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("描述"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.ToTable("Identity_Organization", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("编号"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("版本标识"); + + b.Property("CreatedTime") + .HasColumnType("datetime2") + .HasComment("创建时间"); + + b.Property("DeletedTime") + .HasColumnType("datetime2") + .HasComment("DeletedTime"); + + b.Property("IsAdmin") + .HasColumnType("bit") + .HasComment("是否管理员角色"); + + b.Property("IsDefault") + .HasColumnType("bit") + .HasComment("是否默认角色"); + + b.Property("IsLocked") + .HasColumnType("bit") + .HasComment("是否锁定"); + + b.Property("IsSystem") + .HasColumnType("bit") + .HasComment("是否系统角色"); + + b.Property("MessageId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("角色名称"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("标准化角色名称"); + + b.Property("Remark") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("角色描述"); + + b.HasKey("Id"); + + b.HasIndex("MessageId"); + + b.HasIndex("NormalizedName", "DeletedTime") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[DeletedTime] IS NOT NULL"); + + b.ToTable("Identity_Role", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.RoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("编号"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("声明类型"); + + b.Property("ClaimValue") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)") + .HasComment("声明值"); + + b.Property("RoleId") + .HasColumnType("int") + .HasComment("角色编号"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Identity_RoleClaim", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("编号"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AccessFailedCount") + .HasColumnType("int") + .HasComment("登录失败次数"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("版本标识"); + + b.Property("CreatedTime") + .HasColumnType("datetime2") + .HasComment("创建时间"); + + b.Property("DeletedTime") + .HasColumnType("datetime2") + .HasComment("DeletedTime"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("电子邮箱"); + + b.Property("EmailConfirmed") + .HasColumnType("bit") + .HasComment("电子邮箱确认"); + + b.Property("HeadImg") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)") + .HasComment("用户头像"); + + b.Property("IsLocked") + .HasColumnType("bit") + .HasComment("是否锁定"); + + b.Property("IsSystem") + .HasColumnType("bit") + .HasComment("是否系统用户"); + + b.Property("LockoutEnabled") + .HasColumnType("bit") + .HasComment("是否登录锁"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset") + .HasComment("锁定时间"); + + b.Property("MessageId") + .HasColumnType("uniqueidentifier"); + + b.Property("NickName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("用户昵称"); + + b.Property("NormalizeEmail") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("标准化的电子邮箱"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("标准化的用户名"); + + b.Property("PasswordHash") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("密码哈希值"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasComment("手机号码"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit") + .HasComment("手机号码确定"); + + b.Property("Remark") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("备注"); + + b.Property("SecurityStamp") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("安全标识"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit") + .HasComment("双因子身份验证"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("用户名"); + + b.HasKey("Id"); + + b.HasIndex("MessageId"); + + b.HasIndex("NormalizeEmail", "DeletedTime") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName", "DeletedTime") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[DeletedTime] IS NOT NULL"); + + b.ToTable("Identity_User", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("编号"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("声明类型"); + + b.Property("ClaimValue") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)") + .HasComment("声明值"); + + b.Property("UserId") + .HasColumnType("int") + .HasComment("用户编号"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Identity_UserClaim", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("编号"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("RegisterIp") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasComment("注册IP"); + + b.Property("UserId") + .HasColumnType("int") + .HasComment("用户编号"); + + b.HasKey("Id"); + + b.HasIndex("UserId") + .IsUnique(); + + b.ToTable("Identity_UserDetail", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserLogin", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("Avatar") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)") + .HasComment("第三方用户头像"); + + b.Property("CreatedTime") + .HasColumnType("datetime2") + .HasComment("创建时间"); + + b.Property("LoginProvider") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("登录的登录提供程序"); + + b.Property("ProviderDisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("第三方用户昵称"); + + b.Property("ProviderKey") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("第三方用户的唯一标识"); + + b.Property("UserId") + .HasColumnType("int") + .HasComment("用户编号"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("LoginProvider", "ProviderKey") + .IsUnique() + .HasDatabaseName("UserLoginIndex") + .HasFilter("[LoginProvider] IS NOT NULL AND [ProviderKey] IS NOT NULL"); + + b.ToTable("Identity_UserLogin", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("CreatedTime") + .HasColumnType("datetime2") + .HasComment("创建时间"); + + b.Property("DeletedTime") + .HasColumnType("datetime2") + .HasComment("DeletedTime"); + + b.Property("IsLocked") + .HasColumnType("bit") + .HasComment("是否锁定"); + + b.Property("RoleId") + .HasColumnType("int") + .HasComment("角色编号"); + + b.Property("UserId") + .HasColumnType("int") + .HasComment("用户编号"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId", "RoleId", "DeletedTime") + .IsUnique() + .HasDatabaseName("UserRoleIndex") + .HasFilter("[DeletedTime] IS NOT NULL"); + + b.ToTable("Identity_UserRole", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("LoginProvider") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("登录提供者"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("令牌名称"); + + b.Property("UserId") + .HasColumnType("int") + .HasComment("用户编号"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)") + .HasComment("令牌值"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "LoginProvider", "Name") + .IsUnique() + .HasDatabaseName("UserTokenIndex") + .HasFilter("[LoginProvider] IS NOT NULL AND [Name] IS NOT NULL"); + + b.ToTable("Identity_UserToken", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Infos.Entities.Message", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("BeginDate") + .HasColumnType("datetime2") + .HasComment("生效时间"); + + b.Property("CanReply") + .HasColumnType("bit") + .HasComment("是否允许回复"); + + b.Property("Content") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasComment("内容"); + + b.Property("CreatedTime") + .HasColumnType("datetime2") + .HasComment("创建时间"); + + b.Property("DeletedTime") + .HasColumnType("datetime2") + .HasComment("删除时间"); + + b.Property("EndDate") + .HasColumnType("datetime2") + .HasComment("过期时间"); + + b.Property("IsLocked") + .HasColumnType("bit") + .HasComment("是否锁定"); + + b.Property("IsSended") + .HasColumnType("bit") + .HasComment("是否发送"); + + b.Property("MessageType") + .HasColumnType("int") + .HasComment("消息类型"); + + b.Property("NewReplyCount") + .HasColumnType("int") + .HasComment("新回复数"); + + b.Property("SenderId") + .HasColumnType("int") + .HasComment("发送人编号"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasComment("标题"); + + b.HasKey("Id"); + + b.HasIndex("SenderId"); + + b.ToTable("Infos_Message", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Infos.Entities.MessageReceive", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("CreatedTime") + .HasColumnType("datetime2") + .HasComment("创建时间"); + + b.Property("MessageId") + .HasColumnType("uniqueidentifier") + .HasComment("接收的主消息编号"); + + b.Property("NewReplyCount") + .HasColumnType("int") + .HasComment("新回复数,接收者使用"); + + b.Property("ReadDate") + .HasColumnType("datetime2") + .HasComment("接收时间"); + + b.Property("UserId") + .HasColumnType("int") + .HasComment("消息接收人编号"); + + b.HasKey("Id"); + + b.HasIndex("MessageId"); + + b.HasIndex("UserId"); + + b.ToTable("Infos_MessageReceive", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Infos.Entities.MessageReply", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("BelongMessageId") + .HasColumnType("uniqueidentifier") + .HasComment("回复所属主消息,用于避免递归查询"); + + b.Property("Content") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasComment("消息内容"); + + b.Property("CreatedTime") + .HasColumnType("datetime2") + .HasComment("创建时间"); + + b.Property("DeletedTime") + .HasColumnType("datetime2") + .HasComment("删除时间"); + + b.Property("IsLocked") + .HasColumnType("bit") + .HasComment("是否锁定"); + + b.Property("IsRead") + .HasColumnType("bit") + .HasComment("是否已读"); + + b.Property("ParentMessageId") + .HasColumnType("uniqueidentifier") + .HasComment("回复的主消息,当回复主消息时有效"); + + b.Property("ParentReplyId") + .HasColumnType("uniqueidentifier") + .HasComment("回复的回复消息,当回复回复消息时有效"); + + b.Property("UserId") + .HasColumnType("int") + .HasComment(" 消息回复人编号"); + + b.HasKey("Id"); + + b.HasIndex("BelongMessageId"); + + b.HasIndex("ParentMessageId"); + + b.HasIndex("ParentReplyId"); + + b.HasIndex("UserId"); + + b.ToTable("Infos_MessageReply", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Systems.Entities.AuditEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("EntityKey") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("类型名称"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("实体名称"); + + b.Property("OperateType") + .HasColumnType("int") + .HasComment("OperateType"); + + b.Property("OperationId") + .HasColumnType("uniqueidentifier") + .HasComment("OperationId"); + + b.Property("TypeName") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("类型名称"); + + b.HasKey("Id"); + + b.HasIndex("OperationId"); + + b.ToTable("Systems_AuditEntity", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Systems.Entities.AuditOperation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("Browser") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("浏览器"); + + b.Property("CreatedTime") + .HasColumnType("datetime2") + .HasComment("CreatedTime"); + + b.Property("Elapsed") + .HasColumnType("int") + .HasComment("Elapsed"); + + b.Property("FunctionName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("执行的功能名"); + + b.Property("Ip") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasComment("当前访问IP"); + + b.Property("Message") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)") + .HasComment("消息"); + + b.Property("NickName") + .HasMaxLength(300) + .HasColumnType("nvarchar(300)") + .HasComment("当前用户昵称"); + + b.Property("OperationSystem") + .HasMaxLength(300) + .HasColumnType("nvarchar(300)") + .HasComment("操作系统"); + + b.Property("ResultType") + .HasColumnType("int") + .HasComment("ResultType"); + + b.Property("UserAgent") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("UserAgent"); + + b.Property("UserId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)") + .HasComment("当前用户标识"); + + b.Property("UserName") + .HasMaxLength(300) + .HasColumnType("nvarchar(300)") + .HasComment("当前用户名"); + + b.HasKey("Id"); + + b.ToTable("Systems_AuditOperation", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Systems.Entities.AuditProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("编号"); + + b.Property("AuditEntityId") + .HasColumnType("uniqueidentifier") + .HasComment("AuditEntityId"); + + b.Property("DataType") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("数据类型"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("名称"); + + b.Property("FieldName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComment("字段"); + + b.Property("NewValue") + .HasMaxLength(5000) + .HasColumnType("nvarchar(max)") + .HasComment("新值"); + + b.Property("OriginalValue") + .HasMaxLength(5000) + .HasColumnType("nvarchar(max)") + .HasComment("旧值"); + + b.HasKey("Id"); + + b.HasIndex("AuditEntityId"); + + b.ToTable("Systems_AuditProperty", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Systems.Entities.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("编号"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Acl") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("访问控制列表"); + + b.Property("Data") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)") + .HasComment("菜单数据"); + + b.Property("Icon") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasComment("图标"); + + b.Property("IsEnabled") + .HasColumnType("bit") + .HasComment("是否启用"); + + b.Property("IsSystem") + .HasColumnType("bit") + .HasComment("是否系统"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("名称"); + + b.Property("OrderCode") + .HasColumnType("float") + .HasComment("节点内排序"); + + b.Property("ParentId") + .HasColumnType("int") + .HasComment("父菜单编号"); + + b.Property("Target") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasComment("链接目标"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)") + .HasComment("显示"); + + b.Property("TreePathString") + .HasMaxLength(3000) + .HasColumnType("nvarchar(3000)") + .HasComment("父节点树形路径"); + + b.Property("Url") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)") + .HasComment("链接"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.ToTable("Systems_Menu", (string)null); + }); + + modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.EntityRole", b => + { + b.HasOne("OSharp.Authorization.EntityInfos.EntityInfo", "EntityInfo") + .WithMany() + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("OSharp.Hosting.Identity.Entities.Role", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EntityInfo"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.EntityUser", b => + { + b.HasOne("OSharp.Authorization.EntityInfos.EntityInfo", "EntityInfo") + .WithMany() + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("OSharp.Hosting.Identity.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EntityInfo"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.Module", b => + { + b.HasOne("OSharp.Hosting.Authorization.Entities.Module", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.ModuleFunction", b => + { + b.HasOne("OSharp.Authorization.Functions.Function", "Function") + .WithMany() + .HasForeignKey("FunctionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("OSharp.Hosting.Authorization.Entities.Module", "Module") + .WithMany() + .HasForeignKey("ModuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Function"); + + b.Navigation("Module"); + }); + + modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.ModuleRole", b => + { + b.HasOne("OSharp.Hosting.Authorization.Entities.Module", "Module") + .WithMany() + .HasForeignKey("ModuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("OSharp.Hosting.Identity.Entities.Role", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Module"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.ModuleUser", b => + { + b.HasOne("OSharp.Hosting.Authorization.Entities.Module", "Module") + .WithMany() + .HasForeignKey("ModuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("OSharp.Hosting.Identity.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Module"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.LoginLog", b => + { + b.HasOne("OSharp.Hosting.Identity.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.Organization", b => + { + b.HasOne("OSharp.Hosting.Identity.Entities.Organization", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.Role", b => + { + b.HasOne("OSharp.Hosting.Infos.Entities.Message", null) + .WithMany("PublicRoles") + .HasForeignKey("MessageId"); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.RoleClaim", b => + { + b.HasOne("OSharp.Hosting.Identity.Entities.Role", "Role") + .WithMany("RoleClaims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.User", b => + { + b.HasOne("OSharp.Hosting.Infos.Entities.Message", null) + .WithMany("Recipients") + .HasForeignKey("MessageId"); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserClaim", b => + { + b.HasOne("OSharp.Hosting.Identity.Entities.User", "User") + .WithMany("UserClaims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserDetail", b => + { + b.HasOne("OSharp.Hosting.Identity.Entities.User", "User") + .WithOne("UserDetail") + .HasForeignKey("OSharp.Hosting.Identity.Entities.UserDetail", "UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserLogin", b => + { + b.HasOne("OSharp.Hosting.Identity.Entities.User", "User") + .WithMany("UserLogins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserRole", b => + { + b.HasOne("OSharp.Hosting.Identity.Entities.Role", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("OSharp.Hosting.Identity.Entities.User", "User") + .WithMany("UserRoles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserToken", b => + { + b.HasOne("OSharp.Hosting.Identity.Entities.User", "User") + .WithMany("UserTokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OSharp.Hosting.Infos.Entities.Message", b => + { + b.HasOne("OSharp.Hosting.Identity.Entities.User", "Sender") + .WithMany() + .HasForeignKey("SenderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Sender"); + }); + + modelBuilder.Entity("OSharp.Hosting.Infos.Entities.MessageReceive", b => + { + b.HasOne("OSharp.Hosting.Infos.Entities.Message", "Message") + .WithMany("Receives") + .HasForeignKey("MessageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("OSharp.Hosting.Identity.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Message"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OSharp.Hosting.Infos.Entities.MessageReply", b => + { + b.HasOne("OSharp.Hosting.Infos.Entities.Message", "BelongMessage") + .WithMany() + .HasForeignKey("BelongMessageId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OSharp.Hosting.Infos.Entities.Message", "ParentMessage") + .WithMany("Replies") + .HasForeignKey("ParentMessageId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OSharp.Hosting.Infos.Entities.MessageReply", "ParentReply") + .WithMany("Replies") + .HasForeignKey("ParentReplyId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OSharp.Hosting.Identity.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("BelongMessage"); + + b.Navigation("ParentMessage"); + + b.Navigation("ParentReply"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OSharp.Hosting.Systems.Entities.AuditEntity", b => + { + b.HasOne("OSharp.Hosting.Systems.Entities.AuditOperation", "Operation") + .WithMany("AuditEntities") + .HasForeignKey("OperationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Operation"); + }); + + modelBuilder.Entity("OSharp.Hosting.Systems.Entities.AuditProperty", b => + { + b.HasOne("OSharp.Hosting.Systems.Entities.AuditEntity", "AuditEntity") + .WithMany("Properties") + .HasForeignKey("AuditEntityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AuditEntity"); + }); + + modelBuilder.Entity("OSharp.Hosting.Systems.Entities.Menu", b => + { + b.HasOne("OSharp.Hosting.Systems.Entities.Menu", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.Module", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.Role", b => + { + b.Navigation("RoleClaims"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("OSharp.Hosting.Identity.Entities.User", b => + { + b.Navigation("UserClaims"); + + b.Navigation("UserDetail"); + + b.Navigation("UserLogins"); + + b.Navigation("UserRoles"); + + b.Navigation("UserTokens"); + }); + + modelBuilder.Entity("OSharp.Hosting.Infos.Entities.Message", b => + { + b.Navigation("PublicRoles"); + + b.Navigation("Receives"); + + b.Navigation("Recipients"); + + b.Navigation("Replies"); + }); + + modelBuilder.Entity("OSharp.Hosting.Infos.Entities.MessageReply", b => + { + b.Navigation("Replies"); + }); + + modelBuilder.Entity("OSharp.Hosting.Systems.Entities.AuditEntity", b => + { + b.Navigation("Properties"); + }); + + modelBuilder.Entity("OSharp.Hosting.Systems.Entities.AuditOperation", b => + { + b.Navigation("AuditEntities"); + }); + + modelBuilder.Entity("OSharp.Hosting.Systems.Entities.Menu", b => + { + b.Navigation("Children"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/samples/web/Liuliu.Demo.WebApi/Migrations/20231006102753_Comment.cs b/samples/web/Liuliu.Demo.WebApi/Migrations/20231006102753_Comment.cs new file mode 100644 index 00000000..c4d276f0 --- /dev/null +++ b/samples/web/Liuliu.Demo.WebApi/Migrations/20231006102753_Comment.cs @@ -0,0 +1,4045 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Liuliu.Demo.Web.Migrations +{ + /// + public partial class Comment : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Url", + table: "Systems_Menu", + type: "nvarchar(2000)", + maxLength: 2000, + nullable: true, + comment: "链接", + oldClrType: typeof(string), + oldType: "nvarchar(2000)", + oldMaxLength: 2000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "TreePathString", + table: "Systems_Menu", + type: "nvarchar(3000)", + maxLength: 3000, + nullable: true, + comment: "父节点树形路径", + oldClrType: typeof(string), + oldType: "nvarchar(3000)", + oldMaxLength: 3000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Text", + table: "Systems_Menu", + type: "nvarchar(500)", + maxLength: 500, + nullable: false, + comment: "显示", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500); + + migrationBuilder.AlterColumn( + name: "Target", + table: "Systems_Menu", + type: "nvarchar(50)", + maxLength: 50, + nullable: true, + comment: "链接目标", + oldClrType: typeof(string), + oldType: "nvarchar(50)", + oldMaxLength: 50, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ParentId", + table: "Systems_Menu", + type: "int", + nullable: true, + comment: "父菜单编号", + oldClrType: typeof(int), + oldType: "int", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "OrderCode", + table: "Systems_Menu", + type: "float", + nullable: false, + comment: "节点内排序", + oldClrType: typeof(double), + oldType: "float"); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Systems_Menu", + type: "nvarchar(500)", + maxLength: 500, + nullable: false, + comment: "名称", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500); + + migrationBuilder.AlterColumn( + name: "IsSystem", + table: "Systems_Menu", + type: "bit", + nullable: false, + comment: "是否系统", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "IsEnabled", + table: "Systems_Menu", + type: "bit", + nullable: false, + comment: "是否启用", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "Icon", + table: "Systems_Menu", + type: "nvarchar(50)", + maxLength: 50, + nullable: true, + comment: "图标", + oldClrType: typeof(string), + oldType: "nvarchar(50)", + oldMaxLength: 50, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Data", + table: "Systems_Menu", + type: "nvarchar(2000)", + maxLength: 2000, + nullable: true, + comment: "菜单数据", + oldClrType: typeof(string), + oldType: "nvarchar(2000)", + oldMaxLength: 2000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Acl", + table: "Systems_Menu", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + comment: "访问控制列表", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Systems_Menu", + type: "int", + nullable: false, + comment: "编号", + oldClrType: typeof(int), + oldType: "int") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "ValueType", + table: "Systems_KeyValue", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: true, + comment: "数据值类型名", + oldClrType: typeof(string), + oldType: "nvarchar(1000)", + oldMaxLength: 1000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ValueJson", + table: "Systems_KeyValue", + type: "text", + nullable: true, + comment: "数据值JSON", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Remark", + table: "Systems_KeyValue", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: true, + comment: "显示名称", + oldClrType: typeof(string), + oldType: "nvarchar(1000)", + oldMaxLength: 1000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Order", + table: "Systems_KeyValue", + type: "int", + nullable: false, + comment: "Order", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "Key", + table: "Systems_KeyValue", + type: "nvarchar(512)", + maxLength: 512, + nullable: false, + comment: "数据键名", + oldClrType: typeof(string), + oldType: "nvarchar(512)", + oldMaxLength: 512); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Systems_KeyValue", + type: "bit", + nullable: false, + comment: "是否锁定", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "Display", + table: "Systems_KeyValue", + type: "nvarchar(100)", + maxLength: 100, + nullable: true, + comment: "显示名称", + oldClrType: typeof(string), + oldType: "nvarchar(100)", + oldMaxLength: 100, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Systems_KeyValue", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "OriginalValue", + table: "Systems_AuditProperty", + type: "nvarchar(max)", + maxLength: 5000, + nullable: true, + comment: "旧值", + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldMaxLength: 5000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "NewValue", + table: "Systems_AuditProperty", + type: "nvarchar(max)", + maxLength: 5000, + nullable: true, + comment: "新值", + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldMaxLength: 5000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "FieldName", + table: "Systems_AuditProperty", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "字段", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "DisplayName", + table: "Systems_AuditProperty", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "名称", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "DataType", + table: "Systems_AuditProperty", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "数据类型", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "AuditEntityId", + table: "Systems_AuditProperty", + type: "uniqueidentifier", + nullable: false, + comment: "AuditEntityId", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Systems_AuditProperty", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "UserName", + table: "Systems_AuditOperation", + type: "nvarchar(300)", + maxLength: 300, + nullable: true, + comment: "当前用户名", + oldClrType: typeof(string), + oldType: "nvarchar(300)", + oldMaxLength: 300, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Systems_AuditOperation", + type: "nvarchar(100)", + maxLength: 100, + nullable: true, + comment: "当前用户标识", + oldClrType: typeof(string), + oldType: "nvarchar(100)", + oldMaxLength: 100, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserAgent", + table: "Systems_AuditOperation", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + comment: "UserAgent", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ResultType", + table: "Systems_AuditOperation", + type: "int", + nullable: false, + comment: "ResultType", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "OperationSystem", + table: "Systems_AuditOperation", + type: "nvarchar(300)", + maxLength: 300, + nullable: true, + comment: "操作系统", + oldClrType: typeof(string), + oldType: "nvarchar(300)", + oldMaxLength: 300, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "NickName", + table: "Systems_AuditOperation", + type: "nvarchar(300)", + maxLength: 300, + nullable: true, + comment: "当前用户昵称", + oldClrType: typeof(string), + oldType: "nvarchar(300)", + oldMaxLength: 300, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Message", + table: "Systems_AuditOperation", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: true, + comment: "消息", + oldClrType: typeof(string), + oldType: "nvarchar(1000)", + oldMaxLength: 1000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Ip", + table: "Systems_AuditOperation", + type: "nvarchar(50)", + maxLength: 50, + nullable: true, + comment: "当前访问IP", + oldClrType: typeof(string), + oldType: "nvarchar(50)", + oldMaxLength: 50, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "FunctionName", + table: "Systems_AuditOperation", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + comment: "执行的功能名", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200); + + migrationBuilder.AlterColumn( + name: "Elapsed", + table: "Systems_AuditOperation", + type: "int", + nullable: false, + comment: "Elapsed", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Systems_AuditOperation", + type: "datetime2", + nullable: false, + comment: "CreatedTime", + oldClrType: typeof(DateTime), + oldType: "datetime2"); + + migrationBuilder.AlterColumn( + name: "Browser", + table: "Systems_AuditOperation", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "浏览器", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Systems_AuditOperation", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "TypeName", + table: "Systems_AuditEntity", + type: "nvarchar(500)", + maxLength: 500, + nullable: false, + comment: "类型名称", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500); + + migrationBuilder.AlterColumn( + name: "OperationId", + table: "Systems_AuditEntity", + type: "uniqueidentifier", + nullable: false, + comment: "OperationId", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "OperateType", + table: "Systems_AuditEntity", + type: "int", + nullable: false, + comment: "OperateType", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Systems_AuditEntity", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + comment: "实体名称", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200); + + migrationBuilder.AlterColumn( + name: "EntityKey", + table: "Systems_AuditEntity", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "类型名称", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Systems_AuditEntity", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Infos_MessageReply", + type: "int", + nullable: false, + comment: " 消息回复人编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "ParentReplyId", + table: "Infos_MessageReply", + type: "uniqueidentifier", + nullable: false, + comment: "回复的回复消息,当回复回复消息时有效", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "ParentMessageId", + table: "Infos_MessageReply", + type: "uniqueidentifier", + nullable: false, + comment: "回复的主消息,当回复主消息时有效", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "IsRead", + table: "Infos_MessageReply", + type: "bit", + nullable: false, + comment: "是否已读", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Infos_MessageReply", + type: "bit", + nullable: false, + comment: "是否锁定", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "DeletedTime", + table: "Infos_MessageReply", + type: "datetime2", + nullable: true, + comment: "删除时间", + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Infos_MessageReply", + type: "datetime2", + nullable: false, + comment: "创建时间", + oldClrType: typeof(DateTime), + oldType: "datetime2"); + + migrationBuilder.AlterColumn( + name: "Content", + table: "Infos_MessageReply", + type: "nvarchar(max)", + nullable: false, + comment: "消息内容", + oldClrType: typeof(string), + oldType: "nvarchar(max)"); + + migrationBuilder.AlterColumn( + name: "BelongMessageId", + table: "Infos_MessageReply", + type: "uniqueidentifier", + nullable: false, + comment: "回复所属主消息,用于避免递归查询", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Infos_MessageReply", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Infos_MessageReceive", + type: "int", + nullable: false, + comment: "消息接收人编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "ReadDate", + table: "Infos_MessageReceive", + type: "datetime2", + nullable: false, + comment: "接收时间", + oldClrType: typeof(DateTime), + oldType: "datetime2"); + + migrationBuilder.AlterColumn( + name: "NewReplyCount", + table: "Infos_MessageReceive", + type: "int", + nullable: false, + comment: "新回复数,接收者使用", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "MessageId", + table: "Infos_MessageReceive", + type: "uniqueidentifier", + nullable: false, + comment: "接收的主消息编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Infos_MessageReceive", + type: "datetime2", + nullable: false, + comment: "创建时间", + oldClrType: typeof(DateTime), + oldType: "datetime2"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Infos_MessageReceive", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "Title", + table: "Infos_Message", + type: "nvarchar(max)", + nullable: false, + comment: "标题", + oldClrType: typeof(string), + oldType: "nvarchar(max)"); + + migrationBuilder.AlterColumn( + name: "SenderId", + table: "Infos_Message", + type: "int", + nullable: false, + comment: "发送人编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "NewReplyCount", + table: "Infos_Message", + type: "int", + nullable: false, + comment: "新回复数", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "MessageType", + table: "Infos_Message", + type: "int", + nullable: false, + comment: "消息类型", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "IsSended", + table: "Infos_Message", + type: "bit", + nullable: false, + comment: "是否发送", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Infos_Message", + type: "bit", + nullable: false, + comment: "是否锁定", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "EndDate", + table: "Infos_Message", + type: "datetime2", + nullable: true, + comment: "过期时间", + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "DeletedTime", + table: "Infos_Message", + type: "datetime2", + nullable: true, + comment: "删除时间", + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Infos_Message", + type: "datetime2", + nullable: false, + comment: "创建时间", + oldClrType: typeof(DateTime), + oldType: "datetime2"); + + migrationBuilder.AlterColumn( + name: "Content", + table: "Infos_Message", + type: "nvarchar(max)", + nullable: false, + comment: "内容", + oldClrType: typeof(string), + oldType: "nvarchar(max)"); + + migrationBuilder.AlterColumn( + name: "CanReply", + table: "Infos_Message", + type: "bit", + nullable: false, + comment: "是否允许回复", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "BeginDate", + table: "Infos_Message", + type: "datetime2", + nullable: true, + comment: "生效时间", + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Infos_Message", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "Value", + table: "Identity_UserToken", + type: "nvarchar(2000)", + maxLength: 2000, + nullable: true, + comment: "令牌值", + oldClrType: typeof(string), + oldType: "nvarchar(2000)", + oldMaxLength: 2000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Identity_UserToken", + type: "int", + nullable: false, + comment: "用户编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Identity_UserToken", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "令牌名称", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "LoginProvider", + table: "Identity_UserToken", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "登录提供者", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_UserToken", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Identity_UserRole", + type: "int", + nullable: false, + comment: "用户编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "RoleId", + table: "Identity_UserRole", + type: "int", + nullable: false, + comment: "角色编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Identity_UserRole", + type: "bit", + nullable: false, + comment: "是否锁定", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "DeletedTime", + table: "Identity_UserRole", + type: "datetime2", + nullable: true, + comment: "DeletedTime", + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Identity_UserRole", + type: "datetime2", + nullable: false, + comment: "创建时间", + oldClrType: typeof(DateTime), + oldType: "datetime2"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_UserRole", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Identity_UserLogin", + type: "int", + nullable: false, + comment: "用户编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "ProviderKey", + table: "Identity_UserLogin", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + comment: "第三方用户的唯一标识", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ProviderDisplayName", + table: "Identity_UserLogin", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "第三方用户昵称", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "LoginProvider", + table: "Identity_UserLogin", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "登录的登录提供程序", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Identity_UserLogin", + type: "datetime2", + nullable: false, + comment: "创建时间", + oldClrType: typeof(DateTime), + oldType: "datetime2"); + + migrationBuilder.AlterColumn( + name: "Avatar", + table: "Identity_UserLogin", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: true, + comment: "第三方用户头像", + oldClrType: typeof(string), + oldType: "nvarchar(1000)", + oldMaxLength: 1000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_UserLogin", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Identity_UserDetail", + type: "int", + nullable: false, + comment: "用户编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "RegisterIp", + table: "Identity_UserDetail", + type: "nvarchar(50)", + maxLength: 50, + nullable: true, + comment: "注册IP", + oldClrType: typeof(string), + oldType: "nvarchar(50)", + oldMaxLength: 50, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_UserDetail", + type: "int", + nullable: false, + comment: "编号", + oldClrType: typeof(int), + oldType: "int") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Identity_UserClaim", + type: "int", + nullable: false, + comment: "用户编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "ClaimValue", + table: "Identity_UserClaim", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: true, + comment: "声明值", + oldClrType: typeof(string), + oldType: "nvarchar(1000)", + oldMaxLength: 1000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ClaimType", + table: "Identity_UserClaim", + type: "nvarchar(500)", + maxLength: 500, + nullable: false, + comment: "声明类型", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_UserClaim", + type: "int", + nullable: false, + comment: "编号", + oldClrType: typeof(int), + oldType: "int") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "UserName", + table: "Identity_User", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + comment: "用户名", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200); + + migrationBuilder.AlterColumn( + name: "TwoFactorEnabled", + table: "Identity_User", + type: "bit", + nullable: false, + comment: "双因子身份验证", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "SecurityStamp", + table: "Identity_User", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + comment: "安全标识", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Remark", + table: "Identity_User", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + comment: "备注", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "PhoneNumberConfirmed", + table: "Identity_User", + type: "bit", + nullable: false, + comment: "手机号码确定", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "PhoneNumber", + table: "Identity_User", + type: "nvarchar(50)", + maxLength: 50, + nullable: true, + comment: "手机号码", + oldClrType: typeof(string), + oldType: "nvarchar(50)", + oldMaxLength: 50, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "PasswordHash", + table: "Identity_User", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + comment: "密码哈希值", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "NormalizedUserName", + table: "Identity_User", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + comment: "标准化的用户名", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200); + + migrationBuilder.AlterColumn( + name: "NormalizeEmail", + table: "Identity_User", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "标准化的电子邮箱", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "NickName", + table: "Identity_User", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "用户昵称", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "LockoutEnd", + table: "Identity_User", + type: "datetimeoffset", + nullable: true, + comment: "锁定时间", + oldClrType: typeof(DateTimeOffset), + oldType: "datetimeoffset", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "LockoutEnabled", + table: "Identity_User", + type: "bit", + nullable: false, + comment: "是否登录锁", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "IsSystem", + table: "Identity_User", + type: "bit", + nullable: false, + comment: "是否系统用户", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Identity_User", + type: "bit", + nullable: false, + comment: "是否锁定", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "HeadImg", + table: "Identity_User", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: true, + comment: "用户头像", + oldClrType: typeof(string), + oldType: "nvarchar(1000)", + oldMaxLength: 1000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "EmailConfirmed", + table: "Identity_User", + type: "bit", + nullable: false, + comment: "电子邮箱确认", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "Email", + table: "Identity_User", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "电子邮箱", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "DeletedTime", + table: "Identity_User", + type: "datetime2", + nullable: true, + comment: "DeletedTime", + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Identity_User", + type: "datetime2", + nullable: false, + comment: "创建时间", + oldClrType: typeof(DateTime), + oldType: "datetime2"); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "Identity_User", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + comment: "版本标识", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "AccessFailedCount", + table: "Identity_User", + type: "int", + nullable: false, + comment: "登录失败次数", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_User", + type: "int", + nullable: false, + comment: "编号", + oldClrType: typeof(int), + oldType: "int") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "RoleId", + table: "Identity_RoleClaim", + type: "int", + nullable: false, + comment: "角色编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "ClaimValue", + table: "Identity_RoleClaim", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: true, + comment: "声明值", + oldClrType: typeof(string), + oldType: "nvarchar(1000)", + oldMaxLength: 1000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ClaimType", + table: "Identity_RoleClaim", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + comment: "声明类型", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_RoleClaim", + type: "int", + nullable: false, + comment: "编号", + oldClrType: typeof(int), + oldType: "int") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "Remark", + table: "Identity_Role", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + comment: "角色描述", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "NormalizedName", + table: "Identity_Role", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + comment: "标准化角色名称", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Identity_Role", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + comment: "角色名称", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200); + + migrationBuilder.AlterColumn( + name: "IsSystem", + table: "Identity_Role", + type: "bit", + nullable: false, + comment: "是否系统角色", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Identity_Role", + type: "bit", + nullable: false, + comment: "是否锁定", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "IsDefault", + table: "Identity_Role", + type: "bit", + nullable: false, + comment: "是否默认角色", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "IsAdmin", + table: "Identity_Role", + type: "bit", + nullable: false, + comment: "是否管理员角色", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "DeletedTime", + table: "Identity_Role", + type: "datetime2", + nullable: true, + comment: "DeletedTime", + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Identity_Role", + type: "datetime2", + nullable: false, + comment: "创建时间", + oldClrType: typeof(DateTime), + oldType: "datetime2"); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "Identity_Role", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "版本标识", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_Role", + type: "int", + nullable: false, + comment: "编号", + oldClrType: typeof(int), + oldType: "int") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "Remark", + table: "Identity_Organization", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + comment: "描述", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ParentId", + table: "Identity_Organization", + type: "int", + nullable: true, + comment: "父组织机构编号", + oldClrType: typeof(int), + oldType: "int", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Identity_Organization", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + comment: "名称", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_Organization", + type: "int", + nullable: false, + comment: "编号", + oldClrType: typeof(int), + oldType: "int") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Identity_LoginLog", + type: "int", + nullable: false, + comment: "用户编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "UserAgent", + table: "Identity_LoginLog", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + comment: "用户代理头", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "LogoutTime", + table: "Identity_LoginLog", + type: "datetime2", + nullable: true, + comment: "退出时间", + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Ip", + table: "Identity_LoginLog", + type: "nvarchar(50)", + maxLength: 50, + nullable: true, + comment: "登录IP", + oldClrType: typeof(string), + oldType: "nvarchar(50)", + oldMaxLength: 50, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Identity_LoginLog", + type: "datetime2", + nullable: false, + comment: "创建时间", + oldClrType: typeof(DateTime), + oldType: "datetime2"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_LoginLog", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Auth_ModuleUser", + type: "int", + nullable: false, + comment: "用户编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "ModuleId", + table: "Auth_ModuleUser", + type: "int", + nullable: false, + comment: "模块编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "Disabled", + table: "Auth_ModuleUser", + type: "bit", + nullable: false, + comment: "Disabled", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_ModuleUser", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "RoleId", + table: "Auth_ModuleRole", + type: "int", + nullable: false, + comment: "角色编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "ModuleId", + table: "Auth_ModuleRole", + type: "int", + nullable: false, + comment: "模块编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_ModuleRole", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "ModuleId", + table: "Auth_ModuleFunction", + type: "int", + nullable: false, + comment: "模块编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "FunctionId", + table: "Auth_ModuleFunction", + type: "uniqueidentifier", + nullable: false, + comment: "功能编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_ModuleFunction", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "TreePathString", + table: "Auth_Module", + type: "nvarchar(2000)", + maxLength: 2000, + nullable: true, + comment: "父节点树形路径", + oldClrType: typeof(string), + oldType: "nvarchar(2000)", + oldMaxLength: 2000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Remark", + table: "Auth_Module", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + comment: "模块描述", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ParentId", + table: "Auth_Module", + type: "int", + nullable: true, + comment: "父模块编号", + oldClrType: typeof(int), + oldType: "int", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "OrderCode", + table: "Auth_Module", + type: "float", + nullable: false, + comment: "排序码", + oldClrType: typeof(double), + oldType: "float"); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Auth_Module", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + comment: "模块名称", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200); + + migrationBuilder.AlterColumn( + name: "Code", + table: "Auth_Module", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + comment: "模块代码", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_Module", + type: "int", + nullable: false, + comment: "编号", + oldClrType: typeof(int), + oldType: "int") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Auth_Function", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "名称", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "IsSlaveDatabase", + table: "Auth_Function", + type: "bit", + nullable: false, + comment: "是否从库", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Auth_Function", + type: "bit", + nullable: false, + comment: "是否锁定", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "IsController", + table: "Auth_Function", + type: "bit", + nullable: false, + comment: "是否控制器", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "IsCacheSliding", + table: "Auth_Function", + type: "bit", + nullable: false, + comment: "是否相对过期时间", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "IsAjax", + table: "Auth_Function", + type: "bit", + nullable: false, + comment: "是否Ajax功能", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "IsAccessTypeChanged", + table: "Auth_Function", + type: "bit", + nullable: false, + comment: "访问类型是否更改", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "Controller", + table: "Auth_Function", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "控制器", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CacheExpirationSeconds", + table: "Auth_Function", + type: "int", + nullable: false, + comment: "数据缓存秒数", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "AuditOperationEnabled", + table: "Auth_Function", + type: "bit", + nullable: false, + comment: "是否操作审计", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "AuditEntityEnabled", + table: "Auth_Function", + type: "bit", + nullable: false, + comment: "是否数据审计", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "Area", + table: "Auth_Function", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "区域", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Action", + table: "Auth_Function", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + comment: "功能", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "AccessType", + table: "Auth_Function", + type: "int", + nullable: false, + comment: "访问类型", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_Function", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Auth_EntityUser", + type: "int", + nullable: false, + comment: "用户编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Auth_EntityUser", + type: "bit", + nullable: false, + comment: "是否锁定", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "FilterGroupJson", + table: "Auth_EntityUser", + type: "nvarchar(max)", + maxLength: 5000, + nullable: true, + comment: "过滤条件组Json字符串", + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldMaxLength: 5000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "EntityId", + table: "Auth_EntityUser", + type: "uniqueidentifier", + nullable: false, + comment: "数据编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Auth_EntityUser", + type: "datetime2", + nullable: false, + comment: "创建时间", + oldClrType: typeof(DateTime), + oldType: "datetime2"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_EntityUser", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "RoleId", + table: "Auth_EntityRole", + type: "int", + nullable: false, + comment: "角色编号", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "Operation", + table: "Auth_EntityRole", + type: "int", + nullable: false, + comment: "数据权限操作", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Auth_EntityRole", + type: "bit", + nullable: false, + comment: "是否锁定", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "FilterGroupJson", + table: "Auth_EntityRole", + type: "nvarchar(max)", + maxLength: 5000, + nullable: true, + comment: "过滤条件组Json字符串", + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldMaxLength: 5000, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "EntityId", + table: "Auth_EntityRole", + type: "uniqueidentifier", + nullable: false, + comment: "数据编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Auth_EntityRole", + type: "datetime2", + nullable: false, + comment: "创建时间", + oldClrType: typeof(DateTime), + oldType: "datetime2"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_EntityRole", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + + migrationBuilder.AlterColumn( + name: "TypeName", + table: "Auth_EntityInfo", + type: "nvarchar(500)", + maxLength: 500, + nullable: false, + comment: "实体类型名称", + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500); + + migrationBuilder.AlterColumn( + name: "PropertyJson", + table: "Auth_EntityInfo", + type: "nvarchar(max)", + maxLength: 5000, + nullable: false, + comment: "实体属性信息Json字符串", + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldMaxLength: 5000); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Auth_EntityInfo", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + comment: "实体名称", + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200); + + migrationBuilder.AlterColumn( + name: "AuditEnabled", + table: "Auth_EntityInfo", + type: "bit", + nullable: false, + comment: "是否数据审计", + oldClrType: typeof(bool), + oldType: "bit"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_EntityInfo", + type: "uniqueidentifier", + nullable: false, + comment: "编号", + oldClrType: typeof(Guid), + oldType: "uniqueidentifier"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Url", + table: "Systems_Menu", + type: "nvarchar(2000)", + maxLength: 2000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(2000)", + oldMaxLength: 2000, + oldNullable: true, + oldComment: "链接"); + + migrationBuilder.AlterColumn( + name: "TreePathString", + table: "Systems_Menu", + type: "nvarchar(3000)", + maxLength: 3000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(3000)", + oldMaxLength: 3000, + oldNullable: true, + oldComment: "父节点树形路径"); + + migrationBuilder.AlterColumn( + name: "Text", + table: "Systems_Menu", + type: "nvarchar(500)", + maxLength: 500, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldComment: "显示"); + + migrationBuilder.AlterColumn( + name: "Target", + table: "Systems_Menu", + type: "nvarchar(50)", + maxLength: 50, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(50)", + oldMaxLength: 50, + oldNullable: true, + oldComment: "链接目标"); + + migrationBuilder.AlterColumn( + name: "ParentId", + table: "Systems_Menu", + type: "int", + nullable: true, + oldClrType: typeof(int), + oldType: "int", + oldNullable: true, + oldComment: "父菜单编号"); + + migrationBuilder.AlterColumn( + name: "OrderCode", + table: "Systems_Menu", + type: "float", + nullable: false, + oldClrType: typeof(double), + oldType: "float", + oldComment: "节点内排序"); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Systems_Menu", + type: "nvarchar(500)", + maxLength: 500, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldComment: "名称"); + + migrationBuilder.AlterColumn( + name: "IsSystem", + table: "Systems_Menu", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否系统"); + + migrationBuilder.AlterColumn( + name: "IsEnabled", + table: "Systems_Menu", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否启用"); + + migrationBuilder.AlterColumn( + name: "Icon", + table: "Systems_Menu", + type: "nvarchar(50)", + maxLength: 50, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(50)", + oldMaxLength: 50, + oldNullable: true, + oldComment: "图标"); + + migrationBuilder.AlterColumn( + name: "Data", + table: "Systems_Menu", + type: "nvarchar(2000)", + maxLength: 2000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(2000)", + oldMaxLength: 2000, + oldNullable: true, + oldComment: "菜单数据"); + + migrationBuilder.AlterColumn( + name: "Acl", + table: "Systems_Menu", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true, + oldComment: "访问控制列表"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Systems_Menu", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "编号") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "ValueType", + table: "Systems_KeyValue", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(1000)", + oldMaxLength: 1000, + oldNullable: true, + oldComment: "数据值类型名"); + + migrationBuilder.AlterColumn( + name: "ValueJson", + table: "Systems_KeyValue", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text", + oldNullable: true, + oldComment: "数据值JSON"); + + migrationBuilder.AlterColumn( + name: "Remark", + table: "Systems_KeyValue", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(1000)", + oldMaxLength: 1000, + oldNullable: true, + oldComment: "显示名称"); + + migrationBuilder.AlterColumn( + name: "Order", + table: "Systems_KeyValue", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "Order"); + + migrationBuilder.AlterColumn( + name: "Key", + table: "Systems_KeyValue", + type: "nvarchar(512)", + maxLength: 512, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(512)", + oldMaxLength: 512, + oldComment: "数据键名"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Systems_KeyValue", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否锁定"); + + migrationBuilder.AlterColumn( + name: "Display", + table: "Systems_KeyValue", + type: "nvarchar(100)", + maxLength: 100, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(100)", + oldMaxLength: 100, + oldNullable: true, + oldComment: "显示名称"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Systems_KeyValue", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "OriginalValue", + table: "Systems_AuditProperty", + type: "nvarchar(max)", + maxLength: 5000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldMaxLength: 5000, + oldNullable: true, + oldComment: "旧值"); + + migrationBuilder.AlterColumn( + name: "NewValue", + table: "Systems_AuditProperty", + type: "nvarchar(max)", + maxLength: 5000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldMaxLength: 5000, + oldNullable: true, + oldComment: "新值"); + + migrationBuilder.AlterColumn( + name: "FieldName", + table: "Systems_AuditProperty", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "字段"); + + migrationBuilder.AlterColumn( + name: "DisplayName", + table: "Systems_AuditProperty", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "名称"); + + migrationBuilder.AlterColumn( + name: "DataType", + table: "Systems_AuditProperty", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "数据类型"); + + migrationBuilder.AlterColumn( + name: "AuditEntityId", + table: "Systems_AuditProperty", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "AuditEntityId"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Systems_AuditProperty", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "UserName", + table: "Systems_AuditOperation", + type: "nvarchar(300)", + maxLength: 300, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(300)", + oldMaxLength: 300, + oldNullable: true, + oldComment: "当前用户名"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Systems_AuditOperation", + type: "nvarchar(100)", + maxLength: 100, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(100)", + oldMaxLength: 100, + oldNullable: true, + oldComment: "当前用户标识"); + + migrationBuilder.AlterColumn( + name: "UserAgent", + table: "Systems_AuditOperation", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true, + oldComment: "UserAgent"); + + migrationBuilder.AlterColumn( + name: "ResultType", + table: "Systems_AuditOperation", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "ResultType"); + + migrationBuilder.AlterColumn( + name: "OperationSystem", + table: "Systems_AuditOperation", + type: "nvarchar(300)", + maxLength: 300, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(300)", + oldMaxLength: 300, + oldNullable: true, + oldComment: "操作系统"); + + migrationBuilder.AlterColumn( + name: "NickName", + table: "Systems_AuditOperation", + type: "nvarchar(300)", + maxLength: 300, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(300)", + oldMaxLength: 300, + oldNullable: true, + oldComment: "当前用户昵称"); + + migrationBuilder.AlterColumn( + name: "Message", + table: "Systems_AuditOperation", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(1000)", + oldMaxLength: 1000, + oldNullable: true, + oldComment: "消息"); + + migrationBuilder.AlterColumn( + name: "Ip", + table: "Systems_AuditOperation", + type: "nvarchar(50)", + maxLength: 50, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(50)", + oldMaxLength: 50, + oldNullable: true, + oldComment: "当前访问IP"); + + migrationBuilder.AlterColumn( + name: "FunctionName", + table: "Systems_AuditOperation", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldComment: "执行的功能名"); + + migrationBuilder.AlterColumn( + name: "Elapsed", + table: "Systems_AuditOperation", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "Elapsed"); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Systems_AuditOperation", + type: "datetime2", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldComment: "CreatedTime"); + + migrationBuilder.AlterColumn( + name: "Browser", + table: "Systems_AuditOperation", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "浏览器"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Systems_AuditOperation", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "TypeName", + table: "Systems_AuditEntity", + type: "nvarchar(500)", + maxLength: 500, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldComment: "类型名称"); + + migrationBuilder.AlterColumn( + name: "OperationId", + table: "Systems_AuditEntity", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "OperationId"); + + migrationBuilder.AlterColumn( + name: "OperateType", + table: "Systems_AuditEntity", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "OperateType"); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Systems_AuditEntity", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldComment: "实体名称"); + + migrationBuilder.AlterColumn( + name: "EntityKey", + table: "Systems_AuditEntity", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "类型名称"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Systems_AuditEntity", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Infos_MessageReply", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: " 消息回复人编号"); + + migrationBuilder.AlterColumn( + name: "ParentReplyId", + table: "Infos_MessageReply", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "回复的回复消息,当回复回复消息时有效"); + + migrationBuilder.AlterColumn( + name: "ParentMessageId", + table: "Infos_MessageReply", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "回复的主消息,当回复主消息时有效"); + + migrationBuilder.AlterColumn( + name: "IsRead", + table: "Infos_MessageReply", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否已读"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Infos_MessageReply", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否锁定"); + + migrationBuilder.AlterColumn( + name: "DeletedTime", + table: "Infos_MessageReply", + type: "datetime2", + nullable: true, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true, + oldComment: "删除时间"); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Infos_MessageReply", + type: "datetime2", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldComment: "创建时间"); + + migrationBuilder.AlterColumn( + name: "Content", + table: "Infos_MessageReply", + type: "nvarchar(max)", + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldComment: "消息内容"); + + migrationBuilder.AlterColumn( + name: "BelongMessageId", + table: "Infos_MessageReply", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "回复所属主消息,用于避免递归查询"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Infos_MessageReply", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Infos_MessageReceive", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "消息接收人编号"); + + migrationBuilder.AlterColumn( + name: "ReadDate", + table: "Infos_MessageReceive", + type: "datetime2", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldComment: "接收时间"); + + migrationBuilder.AlterColumn( + name: "NewReplyCount", + table: "Infos_MessageReceive", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "新回复数,接收者使用"); + + migrationBuilder.AlterColumn( + name: "MessageId", + table: "Infos_MessageReceive", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "接收的主消息编号"); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Infos_MessageReceive", + type: "datetime2", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldComment: "创建时间"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Infos_MessageReceive", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "Title", + table: "Infos_Message", + type: "nvarchar(max)", + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldComment: "标题"); + + migrationBuilder.AlterColumn( + name: "SenderId", + table: "Infos_Message", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "发送人编号"); + + migrationBuilder.AlterColumn( + name: "NewReplyCount", + table: "Infos_Message", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "新回复数"); + + migrationBuilder.AlterColumn( + name: "MessageType", + table: "Infos_Message", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "消息类型"); + + migrationBuilder.AlterColumn( + name: "IsSended", + table: "Infos_Message", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否发送"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Infos_Message", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否锁定"); + + migrationBuilder.AlterColumn( + name: "EndDate", + table: "Infos_Message", + type: "datetime2", + nullable: true, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true, + oldComment: "过期时间"); + + migrationBuilder.AlterColumn( + name: "DeletedTime", + table: "Infos_Message", + type: "datetime2", + nullable: true, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true, + oldComment: "删除时间"); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Infos_Message", + type: "datetime2", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldComment: "创建时间"); + + migrationBuilder.AlterColumn( + name: "Content", + table: "Infos_Message", + type: "nvarchar(max)", + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldComment: "内容"); + + migrationBuilder.AlterColumn( + name: "CanReply", + table: "Infos_Message", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否允许回复"); + + migrationBuilder.AlterColumn( + name: "BeginDate", + table: "Infos_Message", + type: "datetime2", + nullable: true, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true, + oldComment: "生效时间"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Infos_Message", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "Value", + table: "Identity_UserToken", + type: "nvarchar(2000)", + maxLength: 2000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(2000)", + oldMaxLength: 2000, + oldNullable: true, + oldComment: "令牌值"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Identity_UserToken", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "用户编号"); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Identity_UserToken", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "令牌名称"); + + migrationBuilder.AlterColumn( + name: "LoginProvider", + table: "Identity_UserToken", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "登录提供者"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_UserToken", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Identity_UserRole", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "用户编号"); + + migrationBuilder.AlterColumn( + name: "RoleId", + table: "Identity_UserRole", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "角色编号"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Identity_UserRole", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否锁定"); + + migrationBuilder.AlterColumn( + name: "DeletedTime", + table: "Identity_UserRole", + type: "datetime2", + nullable: true, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true, + oldComment: "DeletedTime"); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Identity_UserRole", + type: "datetime2", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldComment: "创建时间"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_UserRole", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Identity_UserLogin", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "用户编号"); + + migrationBuilder.AlterColumn( + name: "ProviderKey", + table: "Identity_UserLogin", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true, + oldComment: "第三方用户的唯一标识"); + + migrationBuilder.AlterColumn( + name: "ProviderDisplayName", + table: "Identity_UserLogin", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "第三方用户昵称"); + + migrationBuilder.AlterColumn( + name: "LoginProvider", + table: "Identity_UserLogin", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "登录的登录提供程序"); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Identity_UserLogin", + type: "datetime2", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldComment: "创建时间"); + + migrationBuilder.AlterColumn( + name: "Avatar", + table: "Identity_UserLogin", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(1000)", + oldMaxLength: 1000, + oldNullable: true, + oldComment: "第三方用户头像"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_UserLogin", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Identity_UserDetail", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "用户编号"); + + migrationBuilder.AlterColumn( + name: "RegisterIp", + table: "Identity_UserDetail", + type: "nvarchar(50)", + maxLength: 50, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(50)", + oldMaxLength: 50, + oldNullable: true, + oldComment: "注册IP"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_UserDetail", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "编号") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Identity_UserClaim", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "用户编号"); + + migrationBuilder.AlterColumn( + name: "ClaimValue", + table: "Identity_UserClaim", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(1000)", + oldMaxLength: 1000, + oldNullable: true, + oldComment: "声明值"); + + migrationBuilder.AlterColumn( + name: "ClaimType", + table: "Identity_UserClaim", + type: "nvarchar(500)", + maxLength: 500, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldComment: "声明类型"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_UserClaim", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "编号") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "UserName", + table: "Identity_User", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldComment: "用户名"); + + migrationBuilder.AlterColumn( + name: "TwoFactorEnabled", + table: "Identity_User", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "双因子身份验证"); + + migrationBuilder.AlterColumn( + name: "SecurityStamp", + table: "Identity_User", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true, + oldComment: "安全标识"); + + migrationBuilder.AlterColumn( + name: "Remark", + table: "Identity_User", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true, + oldComment: "备注"); + + migrationBuilder.AlterColumn( + name: "PhoneNumberConfirmed", + table: "Identity_User", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "手机号码确定"); + + migrationBuilder.AlterColumn( + name: "PhoneNumber", + table: "Identity_User", + type: "nvarchar(50)", + maxLength: 50, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(50)", + oldMaxLength: 50, + oldNullable: true, + oldComment: "手机号码"); + + migrationBuilder.AlterColumn( + name: "PasswordHash", + table: "Identity_User", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true, + oldComment: "密码哈希值"); + + migrationBuilder.AlterColumn( + name: "NormalizedUserName", + table: "Identity_User", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldComment: "标准化的用户名"); + + migrationBuilder.AlterColumn( + name: "NormalizeEmail", + table: "Identity_User", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "标准化的电子邮箱"); + + migrationBuilder.AlterColumn( + name: "NickName", + table: "Identity_User", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "用户昵称"); + + migrationBuilder.AlterColumn( + name: "LockoutEnd", + table: "Identity_User", + type: "datetimeoffset", + nullable: true, + oldClrType: typeof(DateTimeOffset), + oldType: "datetimeoffset", + oldNullable: true, + oldComment: "锁定时间"); + + migrationBuilder.AlterColumn( + name: "LockoutEnabled", + table: "Identity_User", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否登录锁"); + + migrationBuilder.AlterColumn( + name: "IsSystem", + table: "Identity_User", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否系统用户"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Identity_User", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否锁定"); + + migrationBuilder.AlterColumn( + name: "HeadImg", + table: "Identity_User", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(1000)", + oldMaxLength: 1000, + oldNullable: true, + oldComment: "用户头像"); + + migrationBuilder.AlterColumn( + name: "EmailConfirmed", + table: "Identity_User", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "电子邮箱确认"); + + migrationBuilder.AlterColumn( + name: "Email", + table: "Identity_User", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "电子邮箱"); + + migrationBuilder.AlterColumn( + name: "DeletedTime", + table: "Identity_User", + type: "datetime2", + nullable: true, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true, + oldComment: "DeletedTime"); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Identity_User", + type: "datetime2", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldComment: "创建时间"); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "Identity_User", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true, + oldComment: "版本标识"); + + migrationBuilder.AlterColumn( + name: "AccessFailedCount", + table: "Identity_User", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "登录失败次数"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_User", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "编号") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "RoleId", + table: "Identity_RoleClaim", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "角色编号"); + + migrationBuilder.AlterColumn( + name: "ClaimValue", + table: "Identity_RoleClaim", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(1000)", + oldMaxLength: 1000, + oldNullable: true, + oldComment: "声明值"); + + migrationBuilder.AlterColumn( + name: "ClaimType", + table: "Identity_RoleClaim", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true, + oldComment: "声明类型"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_RoleClaim", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "编号") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "Remark", + table: "Identity_Role", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true, + oldComment: "角色描述"); + + migrationBuilder.AlterColumn( + name: "NormalizedName", + table: "Identity_Role", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldComment: "标准化角色名称"); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Identity_Role", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldComment: "角色名称"); + + migrationBuilder.AlterColumn( + name: "IsSystem", + table: "Identity_Role", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否系统角色"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Identity_Role", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否锁定"); + + migrationBuilder.AlterColumn( + name: "IsDefault", + table: "Identity_Role", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否默认角色"); + + migrationBuilder.AlterColumn( + name: "IsAdmin", + table: "Identity_Role", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否管理员角色"); + + migrationBuilder.AlterColumn( + name: "DeletedTime", + table: "Identity_Role", + type: "datetime2", + nullable: true, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true, + oldComment: "DeletedTime"); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Identity_Role", + type: "datetime2", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldComment: "创建时间"); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "Identity_Role", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "版本标识"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_Role", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "编号") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "Remark", + table: "Identity_Organization", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true, + oldComment: "描述"); + + migrationBuilder.AlterColumn( + name: "ParentId", + table: "Identity_Organization", + type: "int", + nullable: true, + oldClrType: typeof(int), + oldType: "int", + oldNullable: true, + oldComment: "父组织机构编号"); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Identity_Organization", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldComment: "名称"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_Organization", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "编号") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Identity_LoginLog", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "用户编号"); + + migrationBuilder.AlterColumn( + name: "UserAgent", + table: "Identity_LoginLog", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true, + oldComment: "用户代理头"); + + migrationBuilder.AlterColumn( + name: "LogoutTime", + table: "Identity_LoginLog", + type: "datetime2", + nullable: true, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true, + oldComment: "退出时间"); + + migrationBuilder.AlterColumn( + name: "Ip", + table: "Identity_LoginLog", + type: "nvarchar(50)", + maxLength: 50, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(50)", + oldMaxLength: 50, + oldNullable: true, + oldComment: "登录IP"); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Identity_LoginLog", + type: "datetime2", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldComment: "创建时间"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Identity_LoginLog", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Auth_ModuleUser", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "用户编号"); + + migrationBuilder.AlterColumn( + name: "ModuleId", + table: "Auth_ModuleUser", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "模块编号"); + + migrationBuilder.AlterColumn( + name: "Disabled", + table: "Auth_ModuleUser", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "Disabled"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_ModuleUser", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "RoleId", + table: "Auth_ModuleRole", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "角色编号"); + + migrationBuilder.AlterColumn( + name: "ModuleId", + table: "Auth_ModuleRole", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "模块编号"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_ModuleRole", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "ModuleId", + table: "Auth_ModuleFunction", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "模块编号"); + + migrationBuilder.AlterColumn( + name: "FunctionId", + table: "Auth_ModuleFunction", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "功能编号"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_ModuleFunction", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "TreePathString", + table: "Auth_Module", + type: "nvarchar(2000)", + maxLength: 2000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(2000)", + oldMaxLength: 2000, + oldNullable: true, + oldComment: "父节点树形路径"); + + migrationBuilder.AlterColumn( + name: "Remark", + table: "Auth_Module", + type: "nvarchar(500)", + maxLength: 500, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldNullable: true, + oldComment: "模块描述"); + + migrationBuilder.AlterColumn( + name: "ParentId", + table: "Auth_Module", + type: "int", + nullable: true, + oldClrType: typeof(int), + oldType: "int", + oldNullable: true, + oldComment: "父模块编号"); + + migrationBuilder.AlterColumn( + name: "OrderCode", + table: "Auth_Module", + type: "float", + nullable: false, + oldClrType: typeof(double), + oldType: "float", + oldComment: "排序码"); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Auth_Module", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldComment: "模块名称"); + + migrationBuilder.AlterColumn( + name: "Code", + table: "Auth_Module", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldComment: "模块代码"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_Module", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "编号") + .Annotation("SqlServer:Identity", "1, 1") + .OldAnnotation("SqlServer:Identity", "1, 1"); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Auth_Function", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "名称"); + + migrationBuilder.AlterColumn( + name: "IsSlaveDatabase", + table: "Auth_Function", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否从库"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Auth_Function", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否锁定"); + + migrationBuilder.AlterColumn( + name: "IsController", + table: "Auth_Function", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否控制器"); + + migrationBuilder.AlterColumn( + name: "IsCacheSliding", + table: "Auth_Function", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否相对过期时间"); + + migrationBuilder.AlterColumn( + name: "IsAjax", + table: "Auth_Function", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否Ajax功能"); + + migrationBuilder.AlterColumn( + name: "IsAccessTypeChanged", + table: "Auth_Function", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "访问类型是否更改"); + + migrationBuilder.AlterColumn( + name: "Controller", + table: "Auth_Function", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "控制器"); + + migrationBuilder.AlterColumn( + name: "CacheExpirationSeconds", + table: "Auth_Function", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "数据缓存秒数"); + + migrationBuilder.AlterColumn( + name: "AuditOperationEnabled", + table: "Auth_Function", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否操作审计"); + + migrationBuilder.AlterColumn( + name: "AuditEntityEnabled", + table: "Auth_Function", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否数据审计"); + + migrationBuilder.AlterColumn( + name: "Area", + table: "Auth_Function", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "区域"); + + migrationBuilder.AlterColumn( + name: "Action", + table: "Auth_Function", + type: "nvarchar(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldNullable: true, + oldComment: "功能"); + + migrationBuilder.AlterColumn( + name: "AccessType", + table: "Auth_Function", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "访问类型"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_Function", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Auth_EntityUser", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "用户编号"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Auth_EntityUser", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否锁定"); + + migrationBuilder.AlterColumn( + name: "FilterGroupJson", + table: "Auth_EntityUser", + type: "nvarchar(max)", + maxLength: 5000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldMaxLength: 5000, + oldNullable: true, + oldComment: "过滤条件组Json字符串"); + + migrationBuilder.AlterColumn( + name: "EntityId", + table: "Auth_EntityUser", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "数据编号"); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Auth_EntityUser", + type: "datetime2", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldComment: "创建时间"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_EntityUser", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "RoleId", + table: "Auth_EntityRole", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "角色编号"); + + migrationBuilder.AlterColumn( + name: "Operation", + table: "Auth_EntityRole", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "数据权限操作"); + + migrationBuilder.AlterColumn( + name: "IsLocked", + table: "Auth_EntityRole", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否锁定"); + + migrationBuilder.AlterColumn( + name: "FilterGroupJson", + table: "Auth_EntityRole", + type: "nvarchar(max)", + maxLength: 5000, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldMaxLength: 5000, + oldNullable: true, + oldComment: "过滤条件组Json字符串"); + + migrationBuilder.AlterColumn( + name: "EntityId", + table: "Auth_EntityRole", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "数据编号"); + + migrationBuilder.AlterColumn( + name: "CreatedTime", + table: "Auth_EntityRole", + type: "datetime2", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldComment: "创建时间"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_EntityRole", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + + migrationBuilder.AlterColumn( + name: "TypeName", + table: "Auth_EntityInfo", + type: "nvarchar(500)", + maxLength: 500, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(500)", + oldMaxLength: 500, + oldComment: "实体类型名称"); + + migrationBuilder.AlterColumn( + name: "PropertyJson", + table: "Auth_EntityInfo", + type: "nvarchar(max)", + maxLength: 5000, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldMaxLength: 5000, + oldComment: "实体属性信息Json字符串"); + + migrationBuilder.AlterColumn( + name: "Name", + table: "Auth_EntityInfo", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(200)", + oldMaxLength: 200, + oldComment: "实体名称"); + + migrationBuilder.AlterColumn( + name: "AuditEnabled", + table: "Auth_EntityInfo", + type: "bit", + nullable: false, + oldClrType: typeof(bool), + oldType: "bit", + oldComment: "是否数据审计"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "Auth_EntityInfo", + type: "uniqueidentifier", + nullable: false, + oldClrType: typeof(Guid), + oldType: "uniqueidentifier", + oldComment: "编号"); + } + } +} diff --git a/samples/web/Liuliu.Demo.WebApi/Migrations/DefaultDbContextModelSnapshot.cs b/samples/web/Liuliu.Demo.WebApi/Migrations/DefaultDbContextModelSnapshot.cs index 08433f26..062fc735 100644 --- a/samples/web/Liuliu.Demo.WebApi/Migrations/DefaultDbContextModelSnapshot.cs +++ b/samples/web/Liuliu.Demo.WebApi/Migrations/DefaultDbContextModelSnapshot.cs @@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "7.0.0") + .HasAnnotation("ProductVersion", "7.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); @@ -26,25 +26,30 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("AuditEnabled") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否数据审计"); b.Property("Name") .IsRequired() .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("实体名称"); b.Property("PropertyJson") .IsRequired() .HasMaxLength(5000) - .HasColumnType("nvarchar(max)"); + .HasColumnType("nvarchar(max)") + .HasComment("实体属性信息Json字符串"); b.Property("TypeName") .IsRequired() .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("实体类型名称"); b.HasKey("Id"); @@ -59,53 +64,68 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("AccessType") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("访问类型"); b.Property("Action") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("功能"); b.Property("Area") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("区域"); b.Property("AuditEntityEnabled") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否数据审计"); b.Property("AuditOperationEnabled") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否操作审计"); b.Property("CacheExpirationSeconds") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("数据缓存秒数"); b.Property("Controller") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("控制器"); b.Property("IsAccessTypeChanged") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("访问类型是否更改"); b.Property("IsAjax") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否Ajax功能"); b.Property("IsCacheSliding") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否相对过期时间"); b.Property("IsController") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否控制器"); b.Property("IsLocked") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否锁定"); b.Property("IsSlaveDatabase") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否从库"); b.Property("Name") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("名称"); b.HasKey("Id"); @@ -121,33 +141,41 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("Display") .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasColumnType("nvarchar(100)") + .HasComment("显示名称"); b.Property("IsLocked") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否锁定"); b.Property("Key") .IsRequired() .HasMaxLength(512) - .HasColumnType("nvarchar(512)"); + .HasColumnType("nvarchar(512)") + .HasComment("数据键名"); b.Property("Order") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("Order"); b.Property("Remark") .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); + .HasColumnType("nvarchar(1000)") + .HasComment("显示名称"); b.Property("ValueJson") - .HasColumnType("text"); + .HasColumnType("text") + .HasComment("数据值JSON"); b.Property("ValueType") .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); + .HasColumnType("nvarchar(1000)") + .HasComment("数据值类型名"); b.HasKey("Id"); @@ -162,26 +190,33 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("CreatedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("创建时间"); b.Property("EntityId") - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("数据编号"); b.Property("FilterGroupJson") .HasMaxLength(5000) - .HasColumnType("nvarchar(max)"); + .HasColumnType("nvarchar(max)") + .HasComment("过滤条件组Json字符串"); b.Property("IsLocked") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否锁定"); b.Property("Operation") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("数据权限操作"); b.Property("RoleId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("角色编号"); b.HasKey("Id"); @@ -198,23 +233,29 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("CreatedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("创建时间"); b.Property("EntityId") - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("数据编号"); b.Property("FilterGroupJson") .HasMaxLength(5000) - .HasColumnType("nvarchar(max)"); + .HasColumnType("nvarchar(max)") + .HasComment("过滤条件组Json字符串"); b.Property("IsLocked") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否锁定"); b.Property("UserId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("用户编号"); b.HasKey("Id"); @@ -230,33 +271,40 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("编号"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Code") .IsRequired() .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("模块代码"); b.Property("Name") .IsRequired() .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("模块名称"); b.Property("OrderCode") - .HasColumnType("float"); + .HasColumnType("float") + .HasComment("排序码"); b.Property("ParentId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("父模块编号"); b.Property("Remark") .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("模块描述"); b.Property("TreePathString") .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); + .HasColumnType("nvarchar(2000)") + .HasComment("父节点树形路径"); b.HasKey("Id"); @@ -269,13 +317,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("FunctionId") - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("功能编号"); b.Property("ModuleId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("模块编号"); b.HasKey("Id"); @@ -292,13 +343,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("ModuleId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("模块编号"); b.Property("RoleId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("角色编号"); b.HasKey("Id"); @@ -315,16 +369,20 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("Disabled") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("Disabled"); b.Property("ModuleId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("模块编号"); b.Property("UserId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("用户编号"); b.HasKey("Id"); @@ -341,24 +399,30 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("CreatedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("创建时间"); b.Property("Ip") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("nvarchar(50)") + .HasComment("登录IP"); b.Property("LogoutTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("退出时间"); b.Property("UserAgent") .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("用户代理头"); b.Property("UserId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("用户编号"); b.HasKey("Id"); @@ -371,21 +435,25 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("编号"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Name") .IsRequired() .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("名称"); b.Property("ParentId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("父组织机构编号"); b.Property("Remark") .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("描述"); b.HasKey("Id"); @@ -398,32 +466,40 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("编号"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("版本标识"); b.Property("CreatedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("创建时间"); b.Property("DeletedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("DeletedTime"); b.Property("IsAdmin") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否管理员角色"); b.Property("IsDefault") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否默认角色"); b.Property("IsLocked") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否锁定"); b.Property("IsSystem") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否系统角色"); b.Property("MessageId") .HasColumnType("uniqueidentifier"); @@ -431,16 +507,19 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Name") .IsRequired() .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("角色名称"); b.Property("NormalizedName") .IsRequired() .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("标准化角色名称"); b.Property("Remark") .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("角色描述"); b.HasKey("Id"); @@ -458,20 +537,24 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("编号"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ClaimType") .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("声明类型"); b.Property("ClaimValue") .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); + .HasColumnType("nvarchar(1000)") + .HasComment("声明值"); b.Property("RoleId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("角色编号"); b.HasKey("Id"); @@ -484,89 +567,111 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("编号"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("AccessFailedCount") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("登录失败次数"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("版本标识"); b.Property("CreatedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("创建时间"); b.Property("DeletedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("DeletedTime"); b.Property("Email") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("电子邮箱"); b.Property("EmailConfirmed") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("电子邮箱确认"); b.Property("HeadImg") .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); + .HasColumnType("nvarchar(1000)") + .HasComment("用户头像"); b.Property("IsLocked") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否锁定"); b.Property("IsSystem") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否系统用户"); b.Property("LockoutEnabled") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否登录锁"); b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); + .HasColumnType("datetimeoffset") + .HasComment("锁定时间"); b.Property("MessageId") .HasColumnType("uniqueidentifier"); b.Property("NickName") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("用户昵称"); b.Property("NormalizeEmail") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("标准化的电子邮箱"); b.Property("NormalizedUserName") .IsRequired() .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("标准化的用户名"); b.Property("PasswordHash") .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("密码哈希值"); b.Property("PhoneNumber") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("nvarchar(50)") + .HasComment("手机号码"); b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("手机号码确定"); b.Property("Remark") .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("备注"); b.Property("SecurityStamp") .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("安全标识"); b.Property("TwoFactorEnabled") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("双因子身份验证"); b.Property("UserName") .IsRequired() .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("用户名"); b.HasKey("Id"); @@ -587,21 +692,25 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("编号"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ClaimType") .IsRequired() .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("声明类型"); b.Property("ClaimValue") .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); + .HasColumnType("nvarchar(1000)") + .HasComment("声明值"); b.Property("UserId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("用户编号"); b.HasKey("Id"); @@ -614,16 +723,19 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("编号"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("RegisterIp") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("nvarchar(50)") + .HasComment("注册IP"); b.Property("UserId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("用户编号"); b.HasKey("Id"); @@ -637,29 +749,36 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("Avatar") .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); + .HasColumnType("nvarchar(1000)") + .HasComment("第三方用户头像"); b.Property("CreatedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("创建时间"); b.Property("LoginProvider") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("登录的登录提供程序"); b.Property("ProviderDisplayName") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("第三方用户昵称"); b.Property("ProviderKey") .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("第三方用户的唯一标识"); b.Property("UserId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("用户编号"); b.HasKey("Id"); @@ -677,22 +796,28 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("CreatedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("创建时间"); b.Property("DeletedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("DeletedTime"); b.Property("IsLocked") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否锁定"); b.Property("RoleId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("角色编号"); b.Property("UserId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("用户编号"); b.HasKey("Id"); @@ -710,22 +835,27 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("LoginProvider") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("登录提供者"); b.Property("Name") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("令牌名称"); b.Property("UserId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("用户编号"); b.Property("Value") .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); + .HasColumnType("nvarchar(2000)") + .HasComment("令牌值"); b.HasKey("Id"); @@ -741,45 +871,58 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("BeginDate") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("生效时间"); b.Property("CanReply") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否允许回复"); b.Property("Content") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasColumnType("nvarchar(max)") + .HasComment("内容"); b.Property("CreatedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("创建时间"); b.Property("DeletedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("删除时间"); b.Property("EndDate") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("过期时间"); b.Property("IsLocked") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否锁定"); b.Property("IsSended") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否发送"); b.Property("MessageType") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("消息类型"); b.Property("NewReplyCount") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("新回复数"); b.Property("SenderId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("发送人编号"); b.Property("Title") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasColumnType("nvarchar(max)") + .HasComment("标题"); b.HasKey("Id"); @@ -792,22 +935,28 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("CreatedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("创建时间"); b.Property("MessageId") - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("接收的主消息编号"); b.Property("NewReplyCount") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("新回复数,接收者使用"); b.Property("ReadDate") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("接收时间"); b.Property("UserId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("消息接收人编号"); b.HasKey("Id"); @@ -822,35 +971,45 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("BelongMessageId") - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("回复所属主消息,用于避免递归查询"); b.Property("Content") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasColumnType("nvarchar(max)") + .HasComment("消息内容"); b.Property("CreatedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("创建时间"); b.Property("DeletedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("删除时间"); b.Property("IsLocked") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否锁定"); b.Property("IsRead") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否已读"); b.Property("ParentMessageId") - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("回复的主消息,当回复主消息时有效"); b.Property("ParentReplyId") - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("回复的回复消息,当回复回复消息时有效"); b.Property("UserId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment(" 消息回复人编号"); b.HasKey("Id"); @@ -869,27 +1028,33 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("EntityKey") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("类型名称"); b.Property("Name") .IsRequired() .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("实体名称"); b.Property("OperateType") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("OperateType"); b.Property("OperationId") - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("OperationId"); b.Property("TypeName") .IsRequired() .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("类型名称"); b.HasKey("Id"); @@ -902,53 +1067,66 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("Browser") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("浏览器"); b.Property("CreatedTime") - .HasColumnType("datetime2"); + .HasColumnType("datetime2") + .HasComment("CreatedTime"); b.Property("Elapsed") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("Elapsed"); b.Property("FunctionName") .IsRequired() .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("执行的功能名"); b.Property("Ip") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("nvarchar(50)") + .HasComment("当前访问IP"); b.Property("Message") .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); + .HasColumnType("nvarchar(1000)") + .HasComment("消息"); b.Property("NickName") .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); + .HasColumnType("nvarchar(300)") + .HasComment("当前用户昵称"); b.Property("OperationSystem") .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); + .HasColumnType("nvarchar(300)") + .HasComment("操作系统"); b.Property("ResultType") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("ResultType"); b.Property("UserAgent") .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("UserAgent"); b.Property("UserId") .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasColumnType("nvarchar(100)") + .HasComment("当前用户标识"); b.Property("UserName") .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); + .HasColumnType("nvarchar(300)") + .HasComment("当前用户名"); b.HasKey("Id"); @@ -959,30 +1137,37 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("编号"); b.Property("AuditEntityId") - .HasColumnType("uniqueidentifier"); + .HasColumnType("uniqueidentifier") + .HasComment("AuditEntityId"); b.Property("DataType") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("数据类型"); b.Property("DisplayName") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("名称"); b.Property("FieldName") .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasColumnType("nvarchar(200)") + .HasComment("字段"); b.Property("NewValue") .HasMaxLength(5000) - .HasColumnType("nvarchar(max)"); + .HasColumnType("nvarchar(max)") + .HasComment("新值"); b.Property("OriginalValue") .HasMaxLength(5000) - .HasColumnType("nvarchar(max)"); + .HasColumnType("nvarchar(max)") + .HasComment("旧值"); b.HasKey("Id"); @@ -995,55 +1180,68 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("编号"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Acl") .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("访问控制列表"); b.Property("Data") .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); + .HasColumnType("nvarchar(2000)") + .HasComment("菜单数据"); b.Property("Icon") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("nvarchar(50)") + .HasComment("图标"); b.Property("IsEnabled") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否启用"); b.Property("IsSystem") - .HasColumnType("bit"); + .HasColumnType("bit") + .HasComment("是否系统"); b.Property("Name") .IsRequired() .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("名称"); b.Property("OrderCode") - .HasColumnType("float"); + .HasColumnType("float") + .HasComment("节点内排序"); b.Property("ParentId") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("父菜单编号"); b.Property("Target") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("nvarchar(50)") + .HasComment("链接目标"); b.Property("Text") .IsRequired() .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); + .HasColumnType("nvarchar(500)") + .HasComment("显示"); b.Property("TreePathString") .HasMaxLength(3000) - .HasColumnType("nvarchar(3000)"); + .HasColumnType("nvarchar(3000)") + .HasComment("父节点树形路径"); b.Property("Url") .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); + .HasColumnType("nvarchar(2000)") + .HasComment("链接"); b.HasKey("Id"); diff --git a/samples/web/Liuliu.Demo.WebApi/Startup.cs b/samples/web/Liuliu.Demo.WebApi/Startup.cs index 15349e29..218346e7 100644 --- a/samples/web/Liuliu.Demo.WebApi/Startup.cs +++ b/samples/web/Liuliu.Demo.WebApi/Startup.cs @@ -11,6 +11,7 @@ using OSharp.AspNetCore.Routing; using OSharp.AutoMapper; +using OSharp.Entity; using OSharp.Hangfire; using OSharp.Hosting.Authorization; using OSharp.Hosting.Identity; @@ -45,6 +46,9 @@ public void ConfigureServices(IServiceCollection services) //.AddPack() .AddPack() .AddPack(); + + services.AddSingleton(); + services.AddSingleton(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. diff --git a/src/OSharp.Hosting.Apis/Areas/Admin/Controllers/Auth/EntityInfoController.cs b/src/OSharp.Hosting.Apis/Areas/Admin/Controllers/Auth/EntityInfoController.cs index 015dbaaf..790ed075 100644 --- a/src/OSharp.Hosting.Apis/Areas/Admin/Controllers/Auth/EntityInfoController.cs +++ b/src/OSharp.Hosting.Apis/Areas/Admin/Controllers/Auth/EntityInfoController.cs @@ -49,10 +49,17 @@ public AjaxResult Read(PageRequest request) [HttpGet] [ModuleInfo] [Description("读取节点")] - public List ReadNode() + public AjaxResult ReadNode() { - List nodes = _dataAuthManager.EntityInfos.OrderBy(m => m.TypeName).ToOutput().ToList(); - return nodes; + IFunction function = this.GetExecuteFunction(); + Expression> exp = m => true; + var nodes = CacheService.ToCacheArray(_dataAuthManager.EntityInfos.OrderBy(m => m.TypeName), exp, m => new EntityInfoNode() + { + Id = m.Id, + Name = m.Name, + TypeName = m.TypeName + }, function); + return new AjaxResult(nodes); } /// diff --git a/src/OSharp.Hosting.Apis/Areas/Admin/Controllers/Auth/RoleEntityController.cs b/src/OSharp.Hosting.Apis/Areas/Admin/Controllers/Auth/RoleEntityController.cs index 4fc2c49b..10c87263 100644 --- a/src/OSharp.Hosting.Apis/Areas/Admin/Controllers/Auth/RoleEntityController.cs +++ b/src/OSharp.Hosting.Apis/Areas/Admin/Controllers/Auth/RoleEntityController.cs @@ -38,15 +38,12 @@ public RoleEntityController(IServiceProvider provider) : base(provider) public AjaxResult Read(PageRequest request) { Expression> predicate = FilterService.GetExpression(request.FilterGroup); - if (request.PageCondition.SortConditions.Length == 0) + request.AddDefaultSortCondition(new[] { - request.PageCondition.SortConditions = new[] - { - new SortCondition("RoleId"), - new SortCondition("EntityId"), - new SortCondition("Operation") - }; - } + new SortCondition("RoleId"), + new SortCondition("EntityId"), + new SortCondition("Operation") + }); RoleManager roleManager = HttpContext.RequestServices.GetService>(); Func updateFunc = FilterService.GetDataFilterExpression(null, DataAuthOperation.Update).Compile(); Func deleteFunc = FilterService.GetDataFilterExpression(null, DataAuthOperation.Delete).Compile(); diff --git a/src/OSharp.Hosting.Core/Authorization/Dtos/FunctionOutputDto2.cs b/src/OSharp.Hosting.Core/Authorization/Dtos/FunctionOutputDto2.cs index 9d651f89..782830a1 100644 --- a/src/OSharp.Hosting.Core/Authorization/Dtos/FunctionOutputDto2.cs +++ b/src/OSharp.Hosting.Core/Authorization/Dtos/FunctionOutputDto2.cs @@ -39,4 +39,9 @@ public class FunctionOutputDto2 : IOutputDto /// 获取或设置 控制器名称 /// public string Controller { get; set; } + + /// + /// 获取或设置 动作 + /// + public string Action { get; set; } }