202 lines
7.8 KiB
C#
202 lines
7.8 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using MessageService.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
#nullable disable
|
|
|
|
namespace MessageService.Infrastructure.Migrations
|
|
{
|
|
[DbContext(typeof(MessageDbContext))]
|
|
partial class MessageDbContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "9.0.0")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
|
|
|
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("MessageService.Domain.Entities.Conversation", b =>
|
|
{
|
|
b.Property<string>("ActiveConversationKey")
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasMaxLength(96)
|
|
.HasColumnType("varchar(96)")
|
|
.HasComputedColumnSql("CASE WHEN `IsDeleted` = 0 THEN CONCAT(`UserId`, ':', `ChatType`, ':', `TargetId`) ELSE NULL END", true);
|
|
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<int>("ChatType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTimeOffset>("CreationTime")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTimeOffset?>("Deletion")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("LastMessage")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<DateTimeOffset?>("LastMessageTime")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<long?>("LastReadSequenceId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTimeOffset?>("ModificationTime")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("StreamKey")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("TargetAvatar")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<Guid>("TargetId")
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<string>("TargetName")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("UnreadCount")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("char(36)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ActiveConversationKey")
|
|
.IsUnique()
|
|
.HasDatabaseName("UX_conversations_ActiveConversationKey");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.HasIndex("UserId", "ChatType", "TargetId", "IsDeleted");
|
|
|
|
b.ToTable("conversations", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("MessageService.Domain.Entities.Message", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<int>("ChatType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<Guid>("ClientMsgId")
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<DateTimeOffset>("CreationTime")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTimeOffset?>("Deletion")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<DateTimeOffset?>("ModificationTime")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<int>("MsgType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<Guid>("SenderId")
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<long>("SequenceId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<int>("State")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("StreamKey")
|
|
.IsRequired()
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<Guid>("TargetId")
|
|
.HasColumnType("char(36)");
|
|
|
|
b.ComplexProperty<Dictionary<string, object>>("Content", "MessageService.Domain.Entities.Message.Content#MessageContent", b1 =>
|
|
{
|
|
b1.IsRequired();
|
|
|
|
b1.Property<string>("Fallback")
|
|
.IsRequired()
|
|
.HasMaxLength(255)
|
|
.HasColumnType("varchar(255)")
|
|
.HasAnnotation("Relational:JsonPropertyName", "fallback");
|
|
|
|
b1.Property<string>("RawBody")
|
|
.IsRequired()
|
|
.HasColumnType("longtext")
|
|
.HasColumnName("Content_Body");
|
|
|
|
b1.Property<string>("RawExt")
|
|
.IsRequired()
|
|
.HasColumnType("longtext")
|
|
.HasColumnName("Content_Ext");
|
|
|
|
b1.ComplexProperty<Dictionary<string, object>>("Quote", "MessageService.Domain.Entities.Message.Content#MessageContent.Quote#QuoteInfo", b2 =>
|
|
{
|
|
b2.IsRequired();
|
|
|
|
b2.Property<Guid>("MessageId")
|
|
.HasColumnType("char(36)")
|
|
.HasColumnName("Quote_MsgId");
|
|
|
|
b2.Property<int>("MessageType")
|
|
.HasColumnType("int")
|
|
.HasColumnName("Quote_MsgType");
|
|
|
|
b2.Property<string>("Preview")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("varchar(100)")
|
|
.HasColumnName("Quote_Preview");
|
|
|
|
b2.Property<Guid>("SenderId")
|
|
.HasColumnType("char(36)")
|
|
.HasColumnName("Quote_SenderId");
|
|
|
|
b2.Property<string>("SenderName")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("varchar(50)")
|
|
.HasColumnName("Quote_SenderName");
|
|
});
|
|
});
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("StreamKey", "SequenceId");
|
|
|
|
b.HasIndex("StreamKey", "MsgType", "State", "SequenceId");
|
|
|
|
b.ToTable("messages", (string)null);
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|