🗃️ Add migration for chat read at refactor

This commit is contained in:
2025-05-24 01:31:25 +08:00
parent 213d81a5ca
commit b905d674b7
3 changed files with 3491 additions and 59 deletions

View File

@ -945,6 +945,10 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("joined_at");
b.Property<Instant?>("LastReadAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("last_read_at");
b.Property<Instant?>("LeaveAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("leave_at");
@ -1104,7 +1108,8 @@ namespace DysonNetwork.Sphere.Migrations
b.Property<string>("Type")
.IsRequired()
.HasColumnType("text")
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.HasColumnName("type");
b.Property<Instant>("UpdatedAt")
@ -1178,41 +1183,6 @@ namespace DysonNetwork.Sphere.Migrations
b.ToTable("chat_reactions", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReadReceipt", b =>
{
b.Property<Guid>("MessageId")
.HasColumnType("uuid")
.HasColumnName("message_id");
b.Property<Guid>("SenderId")
.HasColumnType("uuid")
.HasColumnName("sender_id");
b.Property<Instant>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property<Instant?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("deleted_at");
b.Property<Instant>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
b.HasKey("MessageId", "SenderId")
.HasName("pk_chat_read_receipts");
b.HasIndex("SenderId")
.HasDatabaseName("ix_chat_read_receipts_sender_id");
b.HasIndex("MessageId", "SenderId")
.IsUnique()
.HasDatabaseName("ix_chat_read_receipts_message_id_sender_id");
b.ToTable("chat_read_receipts", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b =>
{
b.Property<Guid>("Id")
@ -2909,27 +2879,6 @@ namespace DysonNetwork.Sphere.Migrations
b.Navigation("Sender");
});
modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReadReceipt", b =>
{
b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message")
.WithMany("Statuses")
.HasForeignKey("MessageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_chat_read_receipts_chat_messages_message_id");
b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender")
.WithMany()
.HasForeignKey("SenderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_chat_read_receipts_chat_members_sender_id");
b.Navigation("Message");
b.Navigation("Sender");
});
modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b =>
{
b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "Room")
@ -3400,8 +3349,6 @@ namespace DysonNetwork.Sphere.Migrations
b.Navigation("Attachments");
b.Navigation("Reactions");
b.Navigation("Statuses");
});
modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b =>