1115 lines
42 KiB
C#
1115 lines
42 KiB
C#
// <auto-generated />
|
||
using System;
|
||
using IM_API.Models;
|
||
using Microsoft.EntityFrameworkCore;
|
||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||
using Microsoft.EntityFrameworkCore.Metadata;
|
||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||
|
||
#nullable disable
|
||
|
||
namespace IM_API.Migrations
|
||
{
|
||
[DbContext(typeof(ImContext))]
|
||
partial class ImContextModelSnapshot : ModelSnapshot
|
||
{
|
||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||
{
|
||
#pragma warning disable 612, 618
|
||
modelBuilder
|
||
.UseCollation("latin1_swedish_ci")
|
||
.HasAnnotation("ProductVersion", "8.0.21")
|
||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||
|
||
MySqlModelBuilderExtensions.HasCharSet(modelBuilder, "latin1");
|
||
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
|
||
|
||
modelBuilder.Entity("IM_API.Models.Admin", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<DateTimeOffset>("Created")
|
||
.HasColumnType("datetime")
|
||
.HasComment("创建时间 ");
|
||
|
||
b.Property<string>("Password")
|
||
.IsRequired()
|
||
.HasMaxLength(50)
|
||
.HasColumnType("varchar(50)")
|
||
.HasComment("密码");
|
||
|
||
b.Property<int>("RoleId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("角色");
|
||
|
||
b.Property<sbyte>("State")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasComment("状态(0:正常,2:封禁) ");
|
||
|
||
b.Property<DateTimeOffset>("Updated")
|
||
.HasColumnType("datetime")
|
||
.HasComment("更新时间 ");
|
||
|
||
b.Property<string>("Username")
|
||
.IsRequired()
|
||
.HasMaxLength(50)
|
||
.HasColumnType("varchar(50)")
|
||
.HasComment("用户名");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.HasIndex(new[] { "RoleId" }, "RoleId");
|
||
|
||
b.ToTable("admins", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Conversation", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<int>("ChatType")
|
||
.HasColumnType("int(11)");
|
||
|
||
b.Property<string>("LastMessage")
|
||
.IsRequired()
|
||
.HasMaxLength(255)
|
||
.HasColumnType("varchar(255)")
|
||
.HasComment("最后一条最新消息");
|
||
|
||
b.Property<DateTimeOffset>("LastMessageTime")
|
||
.HasColumnType("datetime")
|
||
.HasComment("最后一条消息发送时间");
|
||
|
||
b.Property<int?>("LastReadSequenceId")
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("lastReadMessageId")
|
||
.HasComment("最后一条未读消息ID ");
|
||
|
||
b.Property<int?>("MessageId")
|
||
.HasColumnType("int(11)");
|
||
|
||
b.Property<string>("StreamKey")
|
||
.IsRequired()
|
||
.HasMaxLength(255)
|
||
.HasColumnType("varchar(255)")
|
||
.HasComment("消息推送唯一标识符");
|
||
|
||
b.Property<int>("TargetId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("对方ID(群聊为群聊ID,单聊为单聊ID) ");
|
||
|
||
b.Property<int>("UnreadCount")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("未读消息数 ");
|
||
|
||
b.Property<int>("UserId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("用户");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.HasIndex("MessageId");
|
||
|
||
b.HasIndex(new[] { "LastReadSequenceId" }, "LastReadSequenceId");
|
||
|
||
b.HasIndex(new[] { "UserId" }, "Userid");
|
||
|
||
b.ToTable("conversations", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Device", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<sbyte>("Dtype")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasColumnName("DType")
|
||
.HasComment("设备类型(\r\n0:Android,1:Ios,2:PC,3:Pad,4:未知)");
|
||
|
||
b.Property<DateTimeOffset>("LastLogin")
|
||
.HasColumnType("datetime")
|
||
.HasComment("最后一次登录 ");
|
||
|
||
b.Property<int>("UserId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("设备所属用户 ");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.HasIndex(new[] { "UserId" }, "Userid")
|
||
.HasDatabaseName("Userid1");
|
||
|
||
b.ToTable("devices", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.File", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<DateTimeOffset>("Created")
|
||
.HasColumnType("datetime")
|
||
.HasComment("创建时间 ");
|
||
|
||
b.Property<string>("FileType")
|
||
.IsRequired()
|
||
.HasMaxLength(10)
|
||
.HasColumnType("varchar(10)")
|
||
.HasComment("文件类型 ");
|
||
|
||
b.Property<int>("MessageId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("关联消息ID ");
|
||
|
||
b.Property<string>("Name")
|
||
.IsRequired()
|
||
.HasMaxLength(50)
|
||
.HasColumnType("varchar(50)")
|
||
.HasComment("文件名 ");
|
||
|
||
b.Property<int>("Size")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("文件大小(单位:KB) ");
|
||
|
||
b.Property<string>("Url")
|
||
.IsRequired()
|
||
.HasMaxLength(100)
|
||
.HasColumnType("varchar(100)")
|
||
.HasColumnName("URL")
|
||
.HasComment("文件储存URL ");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.HasIndex(new[] { "MessageId" }, "Messageld");
|
||
|
||
b.ToTable("files", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Friend", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<string>("Avatar")
|
||
.HasMaxLength(255)
|
||
.HasColumnType("varchar(255)")
|
||
.HasComment("好友头像");
|
||
|
||
b.Property<DateTimeOffset>("Created")
|
||
.HasColumnType("datetime")
|
||
.HasComment("好友关系创建时间");
|
||
|
||
b.Property<int>("FriendId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("用户2ID");
|
||
|
||
b.Property<string>("RemarkName")
|
||
.IsRequired()
|
||
.HasMaxLength(20)
|
||
.HasColumnType("varchar(20)")
|
||
.HasComment("好友备注名");
|
||
|
||
b.Property<sbyte>("Status")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasComment("当前好友关系状态\r\n(0:待通过,1:已添加,2:已拒绝,3:已拉黑)");
|
||
|
||
b.Property<int>("UserId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("用户ID");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.HasIndex(new[] { "Id" }, "ID");
|
||
|
||
b.HasIndex(new[] { "UserId", "FriendId" }, "Userld");
|
||
|
||
b.HasIndex(new[] { "FriendId" }, "用户2id");
|
||
|
||
b.ToTable("friends", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.FriendRequest", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<DateTimeOffset>("Created")
|
||
.HasColumnType("datetime")
|
||
.HasComment("申请时间 ");
|
||
|
||
b.Property<string>("Description")
|
||
.HasColumnType("text")
|
||
.HasComment("申请附言 ");
|
||
|
||
b.Property<string>("RemarkName")
|
||
.IsRequired()
|
||
.HasMaxLength(20)
|
||
.HasColumnType("varchar(20)")
|
||
.HasComment("备注");
|
||
|
||
b.Property<int>("RequestUser")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("申请人 ");
|
||
|
||
b.Property<int>("ResponseUser")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("被申请人 ");
|
||
|
||
b.Property<sbyte>("State")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasComment("申请状态(0:待通过,1:拒绝,2:同意,3:拉黑) ");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.HasIndex(new[] { "RequestUser" }, "RequestUser");
|
||
|
||
b.HasIndex(new[] { "ResponseUser" }, "ResponseUser");
|
||
|
||
b.ToTable("friend_request", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Group", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<sbyte>("AllMembersBanned")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasComment("全员禁言(0允许发言,2全员禁言)");
|
||
|
||
b.Property<string>("Announcement")
|
||
.HasColumnType("text")
|
||
.HasComment("群公告");
|
||
|
||
b.Property<sbyte>("Auhority")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasComment("群权限\r\n(0:需管理员同意,1:任意人可加群,2:不允许任何人加入)");
|
||
|
||
b.Property<string>("Avatar")
|
||
.IsRequired()
|
||
.HasMaxLength(255)
|
||
.HasColumnType("varchar(255)")
|
||
.HasComment("群头像");
|
||
|
||
b.Property<DateTimeOffset>("Created")
|
||
.HasColumnType("datetime")
|
||
.HasComment("群聊创建时间");
|
||
|
||
b.Property<int>("GroupMaster")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("群主");
|
||
|
||
b.Property<string>("LastMessage")
|
||
.IsRequired()
|
||
.HasColumnType("longtext");
|
||
|
||
b.Property<string>("LastSenderName")
|
||
.IsRequired()
|
||
.HasColumnType("longtext");
|
||
|
||
b.Property<DateTimeOffset>("LastUpdateTime")
|
||
.HasColumnType("datetime(6)");
|
||
|
||
b.Property<long>("MaxSequenceId")
|
||
.HasColumnType("bigint");
|
||
|
||
b.Property<string>("Name")
|
||
.IsRequired()
|
||
.HasMaxLength(20)
|
||
.HasColumnType("varchar(20)")
|
||
.HasComment("群聊名称");
|
||
|
||
b.Property<sbyte>("Status")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasComment("群聊状态\r\n(1:正常,2:封禁)");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.HasIndex(new[] { "GroupMaster" }, "GroupMaster");
|
||
|
||
b.HasIndex(new[] { "Id" }, "ID")
|
||
.HasDatabaseName("ID1");
|
||
|
||
b.ToTable("groups", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.GroupInvite", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<DateTimeOffset?>("Created")
|
||
.HasColumnType("datetime")
|
||
.HasComment("创建时间");
|
||
|
||
b.Property<int>("GroupId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("群聊编号");
|
||
|
||
b.Property<int?>("InviteUser")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("邀请用户");
|
||
|
||
b.Property<int?>("InvitedUser")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("被邀请用户");
|
||
|
||
b.Property<sbyte?>("State")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasComment("当前状态(0:待被邀请人同意\r\n1:被邀请人已同意)");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.HasIndex(new[] { "GroupId" }, "GroupId");
|
||
|
||
b.HasIndex(new[] { "InviteUser" }, "InviteUser");
|
||
|
||
b.HasIndex(new[] { "InvitedUser" }, "InvitedUser");
|
||
|
||
b.ToTable("group_invite", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.GroupMember", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<DateTimeOffset>("Created")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("datetime")
|
||
.HasDefaultValueSql("'1970-01-01 00:00:00'")
|
||
.HasComment("加入群聊时间");
|
||
|
||
b.Property<int>("GroupId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("群聊编号");
|
||
|
||
b.Property<sbyte>("Role")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasComment("成员角色(0:普通成员,1:管理员,2:群主)");
|
||
|
||
b.Property<int>("UserId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("用户编号");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.HasIndex(new[] { "GroupId" }, "Groupld");
|
||
|
||
b.HasIndex(new[] { "Id" }, "ID")
|
||
.HasDatabaseName("ID2");
|
||
|
||
b.HasIndex(new[] { "UserId" }, "Userld")
|
||
.HasDatabaseName("Userld1");
|
||
|
||
b.ToTable("group_member", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.GroupRequest", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<DateTimeOffset>("Created")
|
||
.HasColumnType("datetime")
|
||
.HasComment("创建时间");
|
||
|
||
b.Property<string>("Description")
|
||
.IsRequired()
|
||
.HasColumnType("text")
|
||
.HasComment("入群附言");
|
||
|
||
b.Property<int>("GroupId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("群聊编号\r\n");
|
||
|
||
b.Property<sbyte>("State")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasComment("申请状态(0:待管理员同意,1:已拒绝,2:已同意)");
|
||
|
||
b.Property<int>("UserId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("申请人 ");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.HasIndex("UserId");
|
||
|
||
b.HasIndex(new[] { "GroupId" }, "GroupId")
|
||
.HasDatabaseName("GroupId1");
|
||
|
||
b.ToTable("group_request", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.LoginLog", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<sbyte>("Dtype")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasColumnName("DType")
|
||
.HasComment("设备类型(通Devices/DType) ");
|
||
|
||
b.Property<DateTimeOffset>("Logined")
|
||
.HasColumnType("datetime")
|
||
.HasComment("登录时间 ");
|
||
|
||
b.Property<sbyte>("State")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasComment("登录状态(0:登陆成功,1:未验证,2:已被拒绝) ");
|
||
|
||
b.Property<int>("UserId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("登录用户 ");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.HasIndex(new[] { "UserId" }, "Userld")
|
||
.HasDatabaseName("Userld2");
|
||
|
||
b.ToTable("login_log", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Message", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<sbyte>("ChatType")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasComment("聊天类型\r\n(0:私聊,1:群聊)");
|
||
|
||
b.Property<Guid>("ClientMsgId")
|
||
.HasColumnType("char(36)");
|
||
|
||
b.Property<string>("Content")
|
||
.IsRequired()
|
||
.HasColumnType("text")
|
||
.HasComment("消息内容 ");
|
||
|
||
b.Property<DateTimeOffset>("Created")
|
||
.HasColumnType("datetime")
|
||
.HasComment("发送时间 ");
|
||
|
||
b.Property<sbyte>("MsgType")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasComment("消息类型\r\n(0:文本,1:图片,2:语音,3:视频,4:文件,5:语音聊天,6:视频聊天)");
|
||
|
||
b.Property<int>("Recipient")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("接收者(私聊为用户ID,群聊为群聊ID) ");
|
||
|
||
b.Property<int>("Sender")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("发送者 ");
|
||
|
||
b.Property<long>("SequenceId")
|
||
.HasColumnType("bigint");
|
||
|
||
b.Property<sbyte>("State")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasComment("消息状态(0:已发送,1:已撤回) ");
|
||
|
||
b.Property<string>("StreamKey")
|
||
.IsRequired()
|
||
.HasMaxLength(255)
|
||
.HasColumnType("varchar(255)")
|
||
.HasComment("消息推送唯一标识符");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.HasIndex("SequenceId", "StreamKey")
|
||
.IsUnique();
|
||
|
||
b.HasIndex(new[] { "Sender" }, "Sender");
|
||
|
||
b.ToTable("messages", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Notification", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<string>("Content")
|
||
.IsRequired()
|
||
.HasColumnType("text")
|
||
.HasComment("通知内容");
|
||
|
||
b.Property<DateTimeOffset>("Created")
|
||
.HasColumnType("datetime")
|
||
.HasComment("创建时间");
|
||
|
||
b.Property<sbyte>("Ntype")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasColumnName("NType")
|
||
.HasComment("通知类型(0:文本)");
|
||
|
||
b.Property<string>("Title")
|
||
.IsRequired()
|
||
.HasMaxLength(40)
|
||
.HasColumnType("varchar(40)")
|
||
.HasComment("通知标题");
|
||
|
||
b.Property<int>("UserId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("接收人(为空为全体通知)");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.HasIndex(new[] { "UserId" }, "Userld")
|
||
.HasDatabaseName("Userld3");
|
||
|
||
b.ToTable("notifications", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Permission", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<int>("Code")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("权限编码 ");
|
||
|
||
b.Property<DateTimeOffset>("Created")
|
||
.HasColumnType("datetime")
|
||
.HasComment("创建时间 ");
|
||
|
||
b.Property<string>("Name")
|
||
.IsRequired()
|
||
.HasMaxLength(50)
|
||
.HasColumnType("varchar(50)")
|
||
.HasComment("权限名称 ");
|
||
|
||
b.Property<int>("Ptype")
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("PType")
|
||
.HasComment("权限类型(0:增,1:删,2:改,3:查) ");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.ToTable("permissions", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Permissionarole", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
b.Property<int>("PermissionId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("权限 ");
|
||
|
||
b.Property<int>("RoleId")
|
||
.HasColumnType("int(11)")
|
||
.HasComment("角色 ");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.HasIndex(new[] { "PermissionId" }, "Permissionld");
|
||
|
||
b.HasIndex(new[] { "RoleId" }, "Roleld");
|
||
|
||
b.ToTable("permissionarole", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Role", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<DateTimeOffset>("Created")
|
||
.HasColumnType("datetime")
|
||
.HasComment("创建时间 ");
|
||
|
||
b.Property<string>("Description")
|
||
.IsRequired()
|
||
.HasColumnType("text")
|
||
.HasComment("角色描述 ");
|
||
|
||
b.Property<string>("Name")
|
||
.IsRequired()
|
||
.HasMaxLength(20)
|
||
.HasColumnType("varchar(20)")
|
||
.HasComment("角色名称 ");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.ToTable("roles", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.User", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("int(11)")
|
||
.HasColumnName("ID");
|
||
|
||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||
|
||
b.Property<string>("Avatar")
|
||
.HasMaxLength(255)
|
||
.HasColumnType("varchar(255)")
|
||
.HasComment("用户头像链接");
|
||
|
||
b.Property<DateTimeOffset>("Created")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("datetime")
|
||
.HasDefaultValueSql("'1970-01-01 00:00:00'")
|
||
.HasComment("创建时间");
|
||
|
||
b.Property<sbyte>("IsDeleted")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasComment("软删除标识\r\n0:账号正常\r\n1:账号已删除");
|
||
|
||
b.Property<string>("NickName")
|
||
.HasMaxLength(50)
|
||
.HasColumnType("varchar(50)")
|
||
.HasComment("用户昵称");
|
||
|
||
b.Property<sbyte>("OnlineStatus")
|
||
.HasColumnType("tinyint(4)")
|
||
.HasComment("用户在线状态\r\n0(默认):不在线\r\n1:在线");
|
||
|
||
b.Property<string>("Password")
|
||
.IsRequired()
|
||
.HasMaxLength(50)
|
||
.HasColumnType("varchar(50)")
|
||
.HasComment("密码");
|
||
|
||
b.Property<sbyte>("Status")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("tinyint(4)")
|
||
.HasDefaultValueSql("'1'")
|
||
.HasComment("账户状态\r\n(0:未激活,1:正常,2:封禁)");
|
||
|
||
b.Property<DateTimeOffset?>("Updated")
|
||
.HasColumnType("datetime")
|
||
.HasComment("修改时间");
|
||
|
||
b.Property<string>("Username")
|
||
.IsRequired()
|
||
.HasMaxLength(50)
|
||
.HasColumnType("varchar(50)")
|
||
.HasComment("唯一用户名");
|
||
|
||
b.HasKey("Id")
|
||
.HasName("PRIMARY");
|
||
|
||
b.HasIndex(new[] { "Id" }, "ID")
|
||
.HasDatabaseName("ID3");
|
||
|
||
b.HasIndex(new[] { "Username" }, "Username")
|
||
.IsUnique();
|
||
|
||
b.ToTable("users", (string)null);
|
||
|
||
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
|
||
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Admin", b =>
|
||
{
|
||
b.HasOne("IM_API.Models.Role", "Role")
|
||
.WithMany("Admins")
|
||
.HasForeignKey("RoleId")
|
||
.IsRequired()
|
||
.HasConstraintName("admins_ibfk_1");
|
||
|
||
b.Navigation("Role");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Conversation", b =>
|
||
{
|
||
b.HasOne("IM_API.Models.Message", null)
|
||
.WithMany("Conversations")
|
||
.HasForeignKey("MessageId");
|
||
|
||
b.HasOne("IM_API.Models.User", "User")
|
||
.WithMany("Conversations")
|
||
.HasForeignKey("UserId")
|
||
.IsRequired()
|
||
.HasConstraintName("conversations_ibfk_1");
|
||
|
||
b.Navigation("User");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Device", b =>
|
||
{
|
||
b.HasOne("IM_API.Models.User", "User")
|
||
.WithMany("Devices")
|
||
.HasForeignKey("UserId")
|
||
.IsRequired()
|
||
.HasConstraintName("devices_ibfk_1");
|
||
|
||
b.Navigation("User");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.File", b =>
|
||
{
|
||
b.HasOne("IM_API.Models.Message", "Message")
|
||
.WithMany("Files")
|
||
.HasForeignKey("MessageId")
|
||
.IsRequired()
|
||
.HasConstraintName("files_ibfk_1");
|
||
|
||
b.Navigation("Message");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Friend", b =>
|
||
{
|
||
b.HasOne("IM_API.Models.User", "FriendNavigation")
|
||
.WithMany("FriendFriendNavigations")
|
||
.HasForeignKey("FriendId")
|
||
.IsRequired()
|
||
.HasConstraintName("用户2id");
|
||
|
||
b.HasOne("IM_API.Models.User", "User")
|
||
.WithMany("FriendUsers")
|
||
.HasForeignKey("UserId")
|
||
.IsRequired()
|
||
.HasConstraintName("用户id");
|
||
|
||
b.Navigation("FriendNavigation");
|
||
|
||
b.Navigation("User");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.FriendRequest", b =>
|
||
{
|
||
b.HasOne("IM_API.Models.User", "RequestUserNavigation")
|
||
.WithMany("FriendRequestRequestUserNavigations")
|
||
.HasForeignKey("RequestUser")
|
||
.IsRequired()
|
||
.HasConstraintName("friend_request_ibfk_1");
|
||
|
||
b.HasOne("IM_API.Models.User", "ResponseUserNavigation")
|
||
.WithMany("FriendRequestResponseUserNavigations")
|
||
.HasForeignKey("ResponseUser")
|
||
.IsRequired()
|
||
.HasConstraintName("friend_request_ibfk_2");
|
||
|
||
b.Navigation("RequestUserNavigation");
|
||
|
||
b.Navigation("ResponseUserNavigation");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Group", b =>
|
||
{
|
||
b.HasOne("IM_API.Models.User", "GroupMasterNavigation")
|
||
.WithMany("Groups")
|
||
.HasForeignKey("GroupMaster")
|
||
.IsRequired()
|
||
.HasConstraintName("groups_ibfk_1");
|
||
|
||
b.Navigation("GroupMasterNavigation");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.GroupInvite", b =>
|
||
{
|
||
b.HasOne("IM_API.Models.Group", "Group")
|
||
.WithMany("GroupInvites")
|
||
.HasForeignKey("GroupId")
|
||
.IsRequired()
|
||
.HasConstraintName("group_invite_ibfk_2");
|
||
|
||
b.HasOne("IM_API.Models.User", "InviteUserNavigation")
|
||
.WithMany("GroupInviteInviteUserNavigations")
|
||
.HasForeignKey("InviteUser")
|
||
.HasConstraintName("group_invite_ibfk_1");
|
||
|
||
b.HasOne("IM_API.Models.User", "InvitedUserNavigation")
|
||
.WithMany("GroupInviteInvitedUserNavigations")
|
||
.HasForeignKey("InvitedUser")
|
||
.HasConstraintName("group_invite_ibfk_3");
|
||
|
||
b.Navigation("Group");
|
||
|
||
b.Navigation("InviteUserNavigation");
|
||
|
||
b.Navigation("InvitedUserNavigation");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.GroupMember", b =>
|
||
{
|
||
b.HasOne("IM_API.Models.Group", "Group")
|
||
.WithMany("GroupMembers")
|
||
.HasForeignKey("GroupId")
|
||
.IsRequired()
|
||
.HasConstraintName("group_member_ibfk_2");
|
||
|
||
b.HasOne("IM_API.Models.User", "User")
|
||
.WithMany("GroupMembers")
|
||
.HasForeignKey("UserId")
|
||
.IsRequired()
|
||
.HasConstraintName("group_member_ibfk_1");
|
||
|
||
b.Navigation("Group");
|
||
|
||
b.Navigation("User");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.GroupRequest", b =>
|
||
{
|
||
b.HasOne("IM_API.Models.Group", "Group")
|
||
.WithMany("GroupRequests")
|
||
.HasForeignKey("GroupId")
|
||
.IsRequired()
|
||
.HasConstraintName("group_request_ibfk_1");
|
||
|
||
b.HasOne("IM_API.Models.User", "User")
|
||
.WithMany("GroupRequests")
|
||
.HasForeignKey("UserId")
|
||
.IsRequired()
|
||
.HasConstraintName("group_request_ibfk_2");
|
||
|
||
b.Navigation("Group");
|
||
|
||
b.Navigation("User");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.LoginLog", b =>
|
||
{
|
||
b.HasOne("IM_API.Models.User", "User")
|
||
.WithMany("LoginLogs")
|
||
.HasForeignKey("UserId")
|
||
.IsRequired()
|
||
.HasConstraintName("login_log_ibfk_1");
|
||
|
||
b.Navigation("User");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Message", b =>
|
||
{
|
||
b.HasOne("IM_API.Models.User", "SenderNavigation")
|
||
.WithMany("Messages")
|
||
.HasForeignKey("Sender")
|
||
.IsRequired()
|
||
.HasConstraintName("messages_ibfk_1");
|
||
|
||
b.Navigation("SenderNavigation");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Notification", b =>
|
||
{
|
||
b.HasOne("IM_API.Models.User", "User")
|
||
.WithMany("Notifications")
|
||
.HasForeignKey("UserId")
|
||
.IsRequired()
|
||
.HasConstraintName("notifications_ibfk_1");
|
||
|
||
b.Navigation("User");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Permissionarole", b =>
|
||
{
|
||
b.HasOne("IM_API.Models.Permission", "Permission")
|
||
.WithMany("Permissionaroles")
|
||
.HasForeignKey("PermissionId")
|
||
.IsRequired()
|
||
.HasConstraintName("permissionarole_ibfk_2");
|
||
|
||
b.HasOne("IM_API.Models.Role", "Role")
|
||
.WithMany("Permissionaroles")
|
||
.HasForeignKey("RoleId")
|
||
.IsRequired()
|
||
.HasConstraintName("permissionarole_ibfk_1");
|
||
|
||
b.Navigation("Permission");
|
||
|
||
b.Navigation("Role");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Group", b =>
|
||
{
|
||
b.Navigation("GroupInvites");
|
||
|
||
b.Navigation("GroupMembers");
|
||
|
||
b.Navigation("GroupRequests");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Message", b =>
|
||
{
|
||
b.Navigation("Conversations");
|
||
|
||
b.Navigation("Files");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Permission", b =>
|
||
{
|
||
b.Navigation("Permissionaroles");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.Role", b =>
|
||
{
|
||
b.Navigation("Admins");
|
||
|
||
b.Navigation("Permissionaroles");
|
||
});
|
||
|
||
modelBuilder.Entity("IM_API.Models.User", b =>
|
||
{
|
||
b.Navigation("Conversations");
|
||
|
||
b.Navigation("Devices");
|
||
|
||
b.Navigation("FriendFriendNavigations");
|
||
|
||
b.Navigation("FriendRequestRequestUserNavigations");
|
||
|
||
b.Navigation("FriendRequestResponseUserNavigations");
|
||
|
||
b.Navigation("FriendUsers");
|
||
|
||
b.Navigation("GroupInviteInviteUserNavigations");
|
||
|
||
b.Navigation("GroupInviteInvitedUserNavigations");
|
||
|
||
b.Navigation("GroupMembers");
|
||
|
||
b.Navigation("GroupRequests");
|
||
|
||
b.Navigation("Groups");
|
||
|
||
b.Navigation("LoginLogs");
|
||
|
||
b.Navigation("Messages");
|
||
|
||
b.Navigation("Notifications");
|
||
});
|
||
#pragma warning restore 612, 618
|
||
}
|
||
}
|
||
}
|