// using System; using FutureMailAPI.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable namespace FutureMailAPI.Migrations { [DbContext(typeof(FutureMailDbContext))] [Migration("20251018071917_FixDuplicateForeignKeys")] partial class FixDuplicateForeignKeys { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder.HasAnnotation("ProductVersion", "9.0.9"); modelBuilder.Entity("FutureMailAPI.Models.OAuthClient", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("ClientId") .IsRequired() .HasMaxLength(100) .HasColumnType("TEXT"); b.Property("ClientSecret") .IsRequired() .HasMaxLength(255) .HasColumnType("TEXT"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("TEXT") .HasDefaultValueSql("CURRENT_TIMESTAMP"); b.Property("IsActive") .HasColumnType("INTEGER"); b.Property("Name") .IsRequired() .HasMaxLength(100) .HasColumnType("TEXT"); b.Property("RedirectUris") .IsRequired() .HasColumnType("TEXT"); b.Property("Scopes") .IsRequired() .HasColumnType("TEXT"); b.Property("UpdatedAt") .ValueGeneratedOnAdd() .HasColumnType("TEXT") .HasDefaultValueSql("CURRENT_TIMESTAMP"); b.HasKey("Id"); b.HasIndex("ClientId") .IsUnique(); b.ToTable("OAuthClients"); }); modelBuilder.Entity("FutureMailAPI.Models.OAuthToken", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("AccessToken") .IsRequired() .HasMaxLength(255) .HasColumnType("TEXT"); b.Property("ClientId") .HasColumnType("INTEGER"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("TEXT") .HasDefaultValueSql("CURRENT_TIMESTAMP"); b.Property("ExpiresAt") .HasColumnType("TEXT"); b.Property("RefreshToken") .IsRequired() .HasMaxLength(255) .HasColumnType("TEXT"); b.Property("RevokedAt") .HasColumnType("TEXT"); b.Property("Scope") .HasColumnType("TEXT"); b.Property("TokenType") .IsRequired() .HasColumnType("TEXT"); b.Property("UpdatedAt") .HasColumnType("TEXT"); b.Property("UserId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("AccessToken") .IsUnique(); b.HasIndex("ClientId"); b.HasIndex("RefreshToken") .IsUnique(); b.HasIndex("UserId"); b.ToTable("OAuthTokens"); }); modelBuilder.Entity("FutureMailAPI.Models.ReceivedMail", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("IsRead") .HasColumnType("INTEGER"); b.Property("IsReplied") .HasColumnType("INTEGER"); b.Property("ReadAt") .HasColumnType("TEXT"); b.Property("ReceivedAt") .ValueGeneratedOnAdd() .HasColumnType("TEXT") .HasDefaultValueSql("CURRENT_TIMESTAMP"); b.Property("RecipientId") .HasColumnType("INTEGER"); b.Property("ReplyMailId") .HasColumnType("INTEGER"); b.Property("SentMailId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("RecipientId"); b.HasIndex("SentMailId"); b.ToTable("ReceivedMails"); }); modelBuilder.Entity("FutureMailAPI.Models.SentMail", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Attachments") .HasColumnType("TEXT"); b.Property("Content") .IsRequired() .HasColumnType("TEXT"); b.Property("CreatedAt") .HasColumnType("TEXT"); b.Property("DeliveryTime") .HasColumnType("TEXT"); b.Property("EncryptionKey") .HasColumnType("TEXT"); b.Property("IsEncrypted") .HasColumnType("INTEGER"); b.Property("RecipientId") .HasColumnType("INTEGER"); b.Property("RecipientType") .HasColumnType("INTEGER"); b.Property("SenderId") .HasColumnType("INTEGER"); b.Property("SentAt") .ValueGeneratedOnAdd() .HasColumnType("TEXT") .HasDefaultValueSql("CURRENT_TIMESTAMP"); b.Property("Status") .HasColumnType("INTEGER"); b.Property("Theme") .HasMaxLength(50) .HasColumnType("TEXT"); b.Property("Title") .IsRequired() .HasMaxLength(200) .HasColumnType("TEXT"); b.Property("TriggerDetails") .HasColumnType("TEXT"); b.Property("TriggerType") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("RecipientId"); b.HasIndex("SenderId"); b.ToTable("SentMails"); }); modelBuilder.Entity("FutureMailAPI.Models.TimeCapsule", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Color") .HasMaxLength(20) .HasColumnType("TEXT"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("TEXT") .HasDefaultValueSql("CURRENT_TIMESTAMP"); b.Property("GlowIntensity") .HasColumnType("REAL"); b.Property("Opacity") .HasColumnType("REAL"); b.Property("PositionX") .HasColumnType("REAL"); b.Property("PositionY") .HasColumnType("REAL"); b.Property("PositionZ") .HasColumnType("REAL"); b.Property("Rotation") .HasColumnType("REAL"); b.Property("SentMailId") .HasColumnType("INTEGER"); b.Property("SentMailId1") .HasColumnType("INTEGER"); b.Property("Size") .HasColumnType("REAL"); b.Property("Status") .HasColumnType("INTEGER"); b.Property("Style") .HasMaxLength(50) .HasColumnType("TEXT"); b.Property("Type") .HasColumnType("INTEGER"); b.Property("UserId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("SentMailId") .IsUnique(); b.HasIndex("SentMailId1"); b.HasIndex("UserId"); b.ToTable("TimeCapsules"); }); modelBuilder.Entity("FutureMailAPI.Models.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Avatar") .HasMaxLength(500) .HasColumnType("TEXT"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("TEXT") .HasDefaultValueSql("CURRENT_TIMESTAMP"); b.Property("Email") .IsRequired() .HasMaxLength(255) .HasColumnType("TEXT"); b.Property("IsActive") .HasColumnType("INTEGER"); b.Property("LastLoginAt") .HasColumnType("TEXT"); b.Property("Nickname") .HasMaxLength(100) .HasColumnType("TEXT"); b.Property("PasswordHash") .IsRequired() .HasMaxLength(255) .HasColumnType("TEXT"); b.Property("PreferredBackground") .HasMaxLength(50) .HasColumnType("TEXT"); b.Property("PreferredScene") .HasMaxLength(20) .HasColumnType("TEXT"); b.Property("RefreshToken") .HasMaxLength(500) .HasColumnType("TEXT"); b.Property("RefreshTokenExpiryTime") .HasColumnType("TEXT"); b.Property("Salt") .IsRequired() .HasMaxLength(255) .HasColumnType("TEXT"); b.Property("Username") .IsRequired() .HasMaxLength(100) .HasColumnType("TEXT"); b.HasKey("Id"); b.HasIndex("Email") .IsUnique(); b.HasIndex("Username") .IsUnique(); b.ToTable("Users"); }); modelBuilder.Entity("FutureMailAPI.Models.OAuthToken", b => { b.HasOne("FutureMailAPI.Models.OAuthClient", "Client") .WithMany("Tokens") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("FutureMailAPI.Models.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Client"); b.Navigation("User"); }); modelBuilder.Entity("FutureMailAPI.Models.ReceivedMail", b => { b.HasOne("FutureMailAPI.Models.User", "Recipient") .WithMany("ReceivedMails") .HasForeignKey("RecipientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("FutureMailAPI.Models.SentMail", "SentMail") .WithMany() .HasForeignKey("SentMailId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Recipient"); b.Navigation("SentMail"); }); modelBuilder.Entity("FutureMailAPI.Models.SentMail", b => { b.HasOne("FutureMailAPI.Models.User", "Recipient") .WithMany() .HasForeignKey("RecipientId") .OnDelete(DeleteBehavior.SetNull); b.HasOne("FutureMailAPI.Models.User", "Sender") .WithMany("SentMails") .HasForeignKey("SenderId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Recipient"); b.Navigation("Sender"); }); modelBuilder.Entity("FutureMailAPI.Models.TimeCapsule", b => { b.HasOne("FutureMailAPI.Models.SentMail", null) .WithOne("TimeCapsule") .HasForeignKey("FutureMailAPI.Models.TimeCapsule", "SentMailId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("FutureMailAPI.Models.SentMail", "SentMail") .WithMany() .HasForeignKey("SentMailId1") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("FutureMailAPI.Models.User", "User") .WithMany("TimeCapsules") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("SentMail"); b.Navigation("User"); }); modelBuilder.Entity("FutureMailAPI.Models.OAuthClient", b => { b.Navigation("Tokens"); }); modelBuilder.Entity("FutureMailAPI.Models.SentMail", b => { b.Navigation("TimeCapsule"); }); modelBuilder.Entity("FutureMailAPI.Models.User", b => { b.Navigation("ReceivedMails"); b.Navigation("SentMails"); b.Navigation("TimeCapsules"); }); #pragma warning restore 612, 618 } } }