// using System; using Govor.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable namespace Govor.Data.Migrations { [DbContext(typeof(GovorDbContext))] partial class GovorDbContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "8.0.6") .HasAnnotation("Relational:MaxIdentifierLength", 64); MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); modelBuilder.Entity("Govor.Core.Models.ChatGroup", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Description") .IsRequired() .HasMaxLength(500) .HasColumnType("varchar(500)"); b.Property("ImageId") .HasColumnType("char(36)"); b.Property("IsChannel") .HasColumnType("tinyint(1)"); b.Property("IsPrivate") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasMaxLength(100) .HasColumnType("varchar(100)"); b.HasKey("Id"); b.ToTable("ChatGroups"); }); modelBuilder.Entity("Govor.Core.Models.Friendship", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("AddresseeId") .HasColumnType("char(36)"); b.Property("RequesterId") .HasColumnType("char(36)"); b.Property("Status") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("AddresseeId"); b.HasIndex("RequesterId"); b.ToTable("Friendships"); }); modelBuilder.Entity("Govor.Core.Models.GroupAdmins", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("GroupId") .HasColumnType("char(36)"); b.Property("UserId") .HasColumnType("char(36)"); b.HasKey("Id"); b.HasIndex("GroupId"); b.ToTable("GroupAdmins"); }); modelBuilder.Entity("Govor.Core.Models.GroupInvitation", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Description") .IsRequired() .HasMaxLength(500) .HasColumnType("varchar(500)"); b.Property("EndDate") .HasColumnType("datetime(6)"); b.Property("GroupId") .HasColumnType("char(36)"); b.Property("InvitationCode") .IsRequired() .HasMaxLength(200) .HasColumnType("varchar(200)"); b.Property("MaxParticipants") .HasColumnType("int"); b.Property("UserMakerId") .HasColumnType("char(36)"); b.HasKey("Id"); b.HasIndex("GroupId"); b.HasIndex("UserMakerId"); b.ToTable("GroupInvitations"); }); modelBuilder.Entity("Govor.Core.Models.GroupMembership", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("GroupId") .HasColumnType("char(36)"); b.Property("InvitationId") .IsRequired() .HasColumnType("char(36)"); b.Property("IsBanned") .HasColumnType("tinyint(1)"); b.Property("UserId") .HasColumnType("char(36)"); b.HasKey("Id"); b.HasIndex("GroupId"); b.HasIndex("InvitationId"); b.ToTable("GroupMemberships"); }); modelBuilder.Entity("Govor.Core.Models.Invitation", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Code") .IsRequired() .HasColumnType("longtext"); b.Property("DateCreated") .HasColumnType("datetime(6)"); b.Property("Description") .IsRequired() .HasColumnType("longtext"); b.Property("EndDate") .HasColumnType("datetime(6)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("IsAdmin") .HasColumnType("tinyint(1)"); b.Property("MaxParticipants") .HasColumnType("int"); b.HasKey("Id"); b.ToTable("Invitations"); }); modelBuilder.Entity("Govor.Core.Models.MediaFile", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("DateCreated") .HasColumnType("datetime(6)"); b.Property("MediaType") .IsRequired() .HasColumnType("longtext"); b.Property("MineType") .IsRequired() .HasMaxLength(128) .HasColumnType("varchar(128)"); b.Property("Url") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.ToTable("MediaFiles"); }); modelBuilder.Entity("Govor.Core.Models.Messages.MediaAttachments", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("MediaFileId") .HasColumnType("char(36)"); b.Property("MessageId") .HasColumnType("char(36)"); b.HasKey("Id"); b.HasIndex("MediaFileId"); b.HasIndex("MessageId"); b.ToTable("MediaAttachments"); }); modelBuilder.Entity("Govor.Core.Models.Messages.Message", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("ChatGroupId") .HasColumnType("char(36)"); b.Property("EditedAt") .HasColumnType("datetime(6)"); b.Property("EncryptedContent") .IsRequired() .HasColumnType("longtext"); b.Property("IsEdited") .HasColumnType("tinyint(1)"); b.Property("PrivateChatId") .HasColumnType("char(36)"); b.Property("RecipientId") .HasColumnType("char(36)"); b.Property("RecipientType") .HasColumnType("int"); b.Property("ReplyToMessageId") .HasColumnType("char(36)"); b.Property("SenderId") .HasColumnType("char(36)"); b.Property("SentAt") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("ChatGroupId"); b.HasIndex("PrivateChatId"); b.ToTable("Messages"); }); modelBuilder.Entity("Govor.Core.Models.Messages.MessageReaction", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("MessageId") .HasColumnType("char(36)"); b.Property("ReactedAt") .HasColumnType("datetime(6)"); b.Property("ReactionCode") .IsRequired() .HasMaxLength(64) .HasColumnType("varchar(64)"); b.Property("UserId") .HasColumnType("char(36)"); b.HasKey("Id"); b.HasIndex("UserId"); b.HasIndex("MessageId", "UserId") .IsUnique(); b.ToTable("MessageReactions"); }); modelBuilder.Entity("Govor.Core.Models.Messages.MessageView", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("MessageId") .HasColumnType("char(36)"); b.Property("UserId") .HasColumnType("char(36)"); b.Property("ViewedAt") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("MessageId", "UserId") .IsUnique(); b.ToTable("MessageViews"); }); modelBuilder.Entity("Govor.Core.Models.PrivateChat", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("UserAId") .HasColumnType("char(36)"); b.Property("UserBId") .HasColumnType("char(36)"); b.HasKey("Id"); b.ToTable("PrivateChats"); }); modelBuilder.Entity("Govor.Core.Models.Users.Admin", b => { b.Property("UserId") .HasColumnType("char(36)"); b.HasKey("UserId"); b.ToTable("Admins"); }); modelBuilder.Entity("Govor.Core.Models.Users.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedOn") .HasColumnType("date"); b.Property("Description") .IsRequired() .HasColumnType("longtext"); b.Property("IconId") .HasColumnType("char(36)"); b.Property("InviteId") .HasColumnType("char(36)"); b.Property("PasswordHash") .IsRequired() .HasColumnType("longtext"); b.Property("Username") .IsRequired() .HasColumnType("longtext"); b.Property("WasOnline") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("InviteId"); b.ToTable("Users"); }); modelBuilder.Entity("Govor.Core.Models.Friendship", b => { b.HasOne("Govor.Core.Models.Users.User", "Addressee") .WithMany("ReceivedFriendRequests") .HasForeignKey("AddresseeId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Govor.Core.Models.Users.User", "Requester") .WithMany("SentFriendRequests") .HasForeignKey("RequesterId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Addressee"); b.Navigation("Requester"); }); modelBuilder.Entity("Govor.Core.Models.GroupAdmins", b => { b.HasOne("Govor.Core.Models.ChatGroup", null) .WithMany("Admins") .HasForeignKey("GroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Govor.Core.Models.GroupInvitation", b => { b.HasOne("Govor.Core.Models.ChatGroup", null) .WithMany("InviteCodes") .HasForeignKey("GroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Govor.Core.Models.Users.User", "UserMaker") .WithMany() .HasForeignKey("UserMakerId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("UserMaker"); }); modelBuilder.Entity("Govor.Core.Models.GroupMembership", b => { b.HasOne("Govor.Core.Models.ChatGroup", null) .WithMany("Members") .HasForeignKey("GroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Govor.Core.Models.GroupInvitation", null) .WithMany() .HasForeignKey("InvitationId") .OnDelete(DeleteBehavior.SetNull) .IsRequired(); }); modelBuilder.Entity("Govor.Core.Models.Messages.MediaAttachments", b => { b.HasOne("Govor.Core.Models.MediaFile", "MediaFile") .WithMany() .HasForeignKey("MediaFileId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Govor.Core.Models.Messages.Message", "Message") .WithMany("MediaAttachments") .HasForeignKey("MessageId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("MediaFile"); b.Navigation("Message"); }); modelBuilder.Entity("Govor.Core.Models.Messages.Message", b => { b.HasOne("Govor.Core.Models.ChatGroup", null) .WithMany("Messages") .HasForeignKey("ChatGroupId"); b.HasOne("Govor.Core.Models.PrivateChat", null) .WithMany("Messages") .HasForeignKey("PrivateChatId"); }); modelBuilder.Entity("Govor.Core.Models.Messages.MessageReaction", b => { b.HasOne("Govor.Core.Models.Messages.Message", "Message") .WithMany("Reactions") .HasForeignKey("MessageId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Govor.Core.Models.Users.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Message"); b.Navigation("User"); }); modelBuilder.Entity("Govor.Core.Models.Messages.MessageView", b => { b.HasOne("Govor.Core.Models.Messages.Message", null) .WithMany("MessageViews") .HasForeignKey("MessageId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Govor.Core.Models.Users.Admin", b => { b.HasOne("Govor.Core.Models.Users.User", "User") .WithOne() .HasForeignKey("Govor.Core.Models.Users.Admin", "UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("User"); }); modelBuilder.Entity("Govor.Core.Models.Users.User", b => { b.HasOne("Govor.Core.Models.Invitation", "Invite") .WithMany("Users") .HasForeignKey("InviteId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Invite"); }); modelBuilder.Entity("Govor.Core.Models.ChatGroup", b => { b.Navigation("Admins"); b.Navigation("InviteCodes"); b.Navigation("Members"); b.Navigation("Messages"); }); modelBuilder.Entity("Govor.Core.Models.Invitation", b => { b.Navigation("Users"); }); modelBuilder.Entity("Govor.Core.Models.Messages.Message", b => { b.Navigation("MediaAttachments"); b.Navigation("MessageViews"); b.Navigation("Reactions"); }); modelBuilder.Entity("Govor.Core.Models.PrivateChat", b => { b.Navigation("Messages"); }); modelBuilder.Entity("Govor.Core.Models.Users.User", b => { b.Navigation("ReceivedFriendRequests"); b.Navigation("SentFriendRequests"); }); #pragma warning restore 612, 618 } } }