//
using System;
using AliasClientDb;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace AliasClientDb.Migrations
{
[DbContext(typeof(AliasClientDbContext))]
partial class AliasClientDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.4")
.HasAnnotation("Proxies:ChangeTracking", false)
.HasAnnotation("Proxies:CheckEquality", false)
.HasAnnotation("Proxies:LazyLoading", true);
modelBuilder.Entity("AliasClientDb.Attachment", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Blob")
.IsRequired()
.HasColumnType("BLOB");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("Filename")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("ItemId")
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ItemId");
b.ToTable("Attachments");
});
modelBuilder.Entity("AliasClientDb.EncryptionKey", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("IsPrimary")
.HasColumnType("INTEGER");
b.Property("PrivateKey")
.IsRequired()
.HasMaxLength(2000)
.HasColumnType("TEXT");
b.Property("PublicKey")
.IsRequired()
.HasMaxLength(2000)
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("EncryptionKeys");
});
modelBuilder.Entity("AliasClientDb.FieldDefinition", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("ApplicableToTypes")
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("EnableHistory")
.HasColumnType("INTEGER");
b.Property("FieldType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("IsHidden")
.HasColumnType("INTEGER");
b.Property("IsMultiValue")
.HasColumnType("INTEGER");
b.Property("Label")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.Property("Weight")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("FieldDefinitions");
});
modelBuilder.Entity("AliasClientDb.FieldHistory", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("ChangedAt")
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("FieldDefinitionId")
.HasColumnType("TEXT");
b.Property("FieldKey")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("ItemId")
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.Property("ValueSnapshot")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("FieldDefinitionId");
b.HasIndex("ItemId");
b.ToTable("FieldHistories");
});
modelBuilder.Entity("AliasClientDb.FieldValue", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("FieldDefinitionId")
.HasColumnType("TEXT");
b.Property("FieldKey")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("ItemId")
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.Property("Value")
.HasColumnType("TEXT");
b.Property("Weight")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("FieldDefinitionId");
b.HasIndex("FieldKey");
b.HasIndex("ItemId");
b.HasIndex("ItemId", "FieldKey");
b.HasIndex("ItemId", "FieldDefinitionId", "Weight");
b.ToTable("FieldValues");
});
modelBuilder.Entity("AliasClientDb.Folder", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("ParentFolderId")
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.Property("Weight")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("ParentFolderId");
b.ToTable("Folders");
});
modelBuilder.Entity("AliasClientDb.Item", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("DeletedAt")
.HasColumnType("TEXT");
b.Property("FolderId")
.HasColumnType("TEXT");
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("ItemType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("LogoId")
.HasColumnType("TEXT");
b.Property("Name")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("FolderId");
b.HasIndex("LogoId");
b.ToTable("Items");
});
modelBuilder.Entity("AliasClientDb.ItemTag", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("ItemId")
.HasColumnType("TEXT");
b.Property("TagId")
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ItemId");
b.HasIndex("TagId");
b.HasIndex("ItemId", "TagId")
.IsUnique();
b.ToTable("ItemTags");
});
modelBuilder.Entity("AliasClientDb.Logo", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("FetchedAt")
.HasColumnType("TEXT");
b.Property("FileData")
.HasColumnType("BLOB");
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("MimeType")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("Source")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Source")
.IsUnique();
b.ToTable("Logos");
});
modelBuilder.Entity("AliasClientDb.Passkey", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("AdditionalData")
.HasColumnType("BLOB");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("DisplayName")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("ItemId")
.HasColumnType("TEXT");
b.Property("PrfKey")
.HasMaxLength(64)
.HasColumnType("BLOB");
b.Property("PrivateKey")
.IsRequired()
.HasColumnType("TEXT");
b.Property("PublicKey")
.IsRequired()
.HasColumnType("TEXT");
b.Property("RpId")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.Property("UserHandle")
.IsRequired()
.HasColumnType("BLOB");
b.HasKey("Id");
b.HasIndex("ItemId");
b.HasIndex("RpId");
b.ToTable("Passkeys");
});
modelBuilder.Entity("AliasClientDb.Setting", b =>
{
b.Property("Key")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.Property("Value")
.HasColumnType("TEXT");
b.HasKey("Key");
b.ToTable("Settings");
});
modelBuilder.Entity("AliasClientDb.Tag", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Color")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("DisplayOrder")
.HasColumnType("INTEGER");
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("Tags");
});
modelBuilder.Entity("AliasClientDb.TotpCode", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("ItemId")
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("SecretKey")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ItemId");
b.ToTable("TotpCodes");
});
modelBuilder.Entity("AliasClientDb.Attachment", b =>
{
b.HasOne("AliasClientDb.Item", "Item")
.WithMany("Attachments")
.HasForeignKey("ItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Item");
});
modelBuilder.Entity("AliasClientDb.FieldHistory", b =>
{
b.HasOne("AliasClientDb.FieldDefinition", "FieldDefinition")
.WithMany("FieldHistories")
.HasForeignKey("FieldDefinitionId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("AliasClientDb.Item", "Item")
.WithMany()
.HasForeignKey("ItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FieldDefinition");
b.Navigation("Item");
});
modelBuilder.Entity("AliasClientDb.FieldValue", b =>
{
b.HasOne("AliasClientDb.FieldDefinition", "FieldDefinition")
.WithMany("FieldValues")
.HasForeignKey("FieldDefinitionId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("AliasClientDb.Item", "Item")
.WithMany("FieldValues")
.HasForeignKey("ItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FieldDefinition");
b.Navigation("Item");
});
modelBuilder.Entity("AliasClientDb.Folder", b =>
{
b.HasOne("AliasClientDb.Folder", "ParentFolder")
.WithMany("ChildFolders")
.HasForeignKey("ParentFolderId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("ParentFolder");
});
modelBuilder.Entity("AliasClientDb.Item", b =>
{
b.HasOne("AliasClientDb.Folder", "Folder")
.WithMany("Items")
.HasForeignKey("FolderId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("AliasClientDb.Logo", "Logo")
.WithMany("Items")
.HasForeignKey("LogoId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("Folder");
b.Navigation("Logo");
});
modelBuilder.Entity("AliasClientDb.ItemTag", b =>
{
b.HasOne("AliasClientDb.Item", "Item")
.WithMany("ItemTags")
.HasForeignKey("ItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AliasClientDb.Tag", "Tag")
.WithMany("ItemTags")
.HasForeignKey("TagId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Item");
b.Navigation("Tag");
});
modelBuilder.Entity("AliasClientDb.Passkey", b =>
{
b.HasOne("AliasClientDb.Item", "Item")
.WithMany("Passkeys")
.HasForeignKey("ItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Item");
});
modelBuilder.Entity("AliasClientDb.TotpCode", b =>
{
b.HasOne("AliasClientDb.Item", "Item")
.WithMany("TotpCodes")
.HasForeignKey("ItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Item");
});
modelBuilder.Entity("AliasClientDb.FieldDefinition", b =>
{
b.Navigation("FieldHistories");
b.Navigation("FieldValues");
});
modelBuilder.Entity("AliasClientDb.Folder", b =>
{
b.Navigation("ChildFolders");
b.Navigation("Items");
});
modelBuilder.Entity("AliasClientDb.Item", b =>
{
b.Navigation("Attachments");
b.Navigation("FieldValues");
b.Navigation("ItemTags");
b.Navigation("Passkeys");
b.Navigation("TotpCodes");
});
modelBuilder.Entity("AliasClientDb.Logo", b =>
{
b.Navigation("Items");
});
modelBuilder.Entity("AliasClientDb.Tag", b =>
{
b.Navigation("ItemTags");
});
#pragma warning restore 612, 618
}
}
}