Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Update client EF migrations logos table (#2159)

Leendert de Borst6ce6e0a141bb
diff --git a/apps/server/Databases/AliasClientDb/AliasClientDbContext.cs b/apps/server/Databases/AliasClientDb/AliasClientDbContext.cs
index bc55f3e7f..2636e301c 100644
--- a/apps/server/Databases/AliasClientDb/AliasClientDbContext.cs
+++ b/apps/server/Databases/AliasClientDb/AliasClientDbContext.cs
@@ -184,13 +184,18 @@ public class AliasClientDbContext : DbContext
.HasForeignKey(f => f.ParentFolderId)
.OnDelete(DeleteBehavior.Cascade);
- // Configure Logo unique index on (SharedFolderId, Source): a logo belongs to exactly one
- // manifest, so the same domain may appear once in the personal vault (SharedFolderId NULL)
- // and once per shared folder. See core/rust/src/vault_codec/logos.rs.
+ // Configure Logo unique index on (SharedFolderId, Kind, Source): an icon belongs to exactly one
+ // manifest, so the same natural key may appear once in the personal vault (SharedFolderId NULL)
+ // and once per shared folder.
modelBuilder.Entity<Logo>()
- .HasIndex(l => new { l.SharedFolderId, l.Source })
+ .HasIndex(l => new { l.SharedFolderId, l.Kind, l.Source })
.IsUnique();
+ // Kind defaults to 'favicon' for legacy reasons and backwards compatibility.
+ modelBuilder.Entity<Logo>()
+ .Property(l => l.Kind)
+ .HasDefaultValue(Logo.KindFavicon);
+
// Configure FieldValue - Item relationship
modelBuilder.Entity<FieldValue>()
.HasOne(fv => fv.Item)
diff --git a/apps/server/Databases/AliasClientDb/Logo.cs b/apps/server/Databases/AliasClientDb/Logo.cs
index 2a53bf5dd..148eaef59 100644
--- a/apps/server/Databases/AliasClientDb/Logo.cs
+++ b/apps/server/Databases/AliasClientDb/Logo.cs
@@ -11,18 +11,49 @@ using System.ComponentModel.DataAnnotations;
using AliasClientDb.Abstracts;
/// <summary>
-/// Logo entity for deduplicated logo storage.
+/// An item's logo.
/// </summary>
public class Logo : SyncableEntity
{
/// <summary>
- /// Gets or sets the logo ID.
+ /// The <see cref="Kind"/> of a logo fetched automatically from an item's URL. <see cref="Source"/>
+ /// is the domain it was fetched from.
+ /// </summary>
+ public const string KindFavicon = "favicon";
+
+ /// <summary>
+ /// The <see cref="Kind"/> of a logo the user picked from the built-in catalog. <see cref="Source"/>
+ /// is the catalog key (see core/models/src/icons/AppIcons.ts) and there is no image data: every
+ /// platform draws the logo itself.
+ /// </summary>
+ public const string KindBuiltin = "builtin";
+
+ /// <summary>
+ /// The <see cref="Kind"/> of a logo the user uploaded. <see cref="Source"/> is the sha256 of
+ /// <see cref="FileData"/> as lowercase hex, which is what makes an uploaded image reusable: picking
+ /// it again resolves to the row that already holds those bytes.
+ /// </summary>
+ public const string KindCustom = "custom";
+
+ /// <summary>
+ /// Gets or sets the logo ID. Deterministically derived from (SharedFolderId, Kind, Source) via Rust core.
/// </summary>
[Key]
public Guid Id { get; set; }
/// <summary>
- /// Gets or sets the source domain (e.g., 'github.com').
+ /// Gets or sets where this logo comes from: <see cref="KindFavicon"/>, <see cref="KindBuiltin"/>, or
+ /// <see cref="KindCustom"/>. It is part of the natural key because each kind keys <see cref="Source"/>
+ /// in its own space. An unrecognized kind is ignored by the UI and falls back to a placeholder.
+ /// </summary>
+ [Required]
+ [StringLength(20)]
+ public string Kind { get; set; } = KindFavicon;
+
+ /// <summary>
+ /// Gets or sets this icon's natural key within its <see cref="Kind"/>: the source domain
+ /// ('github.com') for a favicon, the catalog key ('shopping') for a built-in icon, or the image's
+ /// sha256 for an uploaded one.
/// Unique per manifest scope (see <see cref="SharedFolderId"/>), so logos are deduplicated within
/// the personal vault and within each shared folder, but never across them.
/// </summary>
@@ -32,16 +63,22 @@ public class Logo : SyncableEntity
/// <summary>
/// Gets or sets the shared folder this logo belongs to, or null when it belongs to the user's own
- /// (personal) vault. A logo lives in exactly one manifest: two members of a shared folder each keep
+ /// (personal) vault. An icon lives in exactly one manifest: two members of a shared folder each keep
/// their own personal icon for a domain while the folder keeps the one its items use.
/// </summary>
public Guid? SharedFolderId { get; set; }
/// <summary>
- /// Gets or sets the logo file data.
+ /// Gets or sets the logo image data. Null for <see cref="KindBuiltin"/>, which carries no bytes.
/// </summary>
public byte[]? FileData { get; set; }
+ /// <summary>
+ /// Gets or sets an optional user-facing label, shown for uploaded logos in the logo library.
+ /// </summary>
+ [StringLength(255)]
+ public string? Name { get; set; }
+
/// <summary>
/// Gets or sets the MIME type of the logo.
/// </summary>
diff --git a/apps/server/Databases/AliasClientDb/Migrations/20260721081936_2.1.0-AddCodecOverflows.Designer.cs b/apps/server/Databases/AliasClientDb/Migrations/20260721081936_2.1.0-AddCodecOverflows.Designer.cs
deleted file mode 100644
index ce7de2440..000000000
--- a/apps/server/Databases/AliasClientDb/Migrations/20260721081936_2.1.0-AddCodecOverflows.Designer.cs
+++ /dev/null
@@ -1,690 +0,0 @@
-// <auto-generated />
-using System;
-using AliasClientDb;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-
-#nullable disable
-
-namespace AliasClientDb.Migrations
-{
- [DbContext(typeof(AliasClientDbContext))]
- [Migration("20260721081936_2.1.0-AddCodecOverflows")]
- partial class _210AddCodecOverflows
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "10.0.10")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasClientDb.Attachment", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<byte[]>("Blob")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsDeleted")
- .HasColumnType("INTEGER");
-
- b.Property<Guid>("ItemId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("ItemId");
-
- b.ToTable("Attachments");
- });
-
- modelBuilder.Entity("AliasClientDb.CodecOverflow", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Data")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("CodecOverflows");
- });
-
- modelBuilder.Entity("AliasClientDb.EncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsDeleted")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PrivateKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("EncryptionKeys");
- });
-
- modelBuilder.Entity("AliasClientDb.FieldDefinition", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("ApplicableToTypes")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EnableHistory")
- .HasColumnType("INTEGER");
-
- b.Property<string>("FieldType")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsDeleted")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsHidden")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsMultiValue")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Label")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("Weight")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.ToTable("FieldDefinitions");
- });
-
- modelBuilder.Entity("AliasClientDb.FieldHistory", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid?>("FieldDefinitionId")
- .HasColumnType("TEXT");
-
- b.Property<string>("FieldKey")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsDeleted")
- .HasColumnType("INTEGER");
-
- b.Property<Guid>("ItemId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("ValueSnapshot")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("FieldDefinitionId");
-
- b.HasIndex("ItemId");
-
- b.ToTable("FieldHistories");
- });
-
- modelBuilder.Entity("AliasClientDb.FieldValue", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid?>("FieldDefinitionId")
- .HasColumnType("TEXT");
-
- b.Property<string>("FieldKey")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsDeleted")
- .HasColumnType("INTEGER");
-
- b.Property<Guid>("ItemId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.Property<int>("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<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsDeleted")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<Guid?>("ParentFolderId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("Weight")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("ParentFolderId");
-
- b.ToTable("Folders");
- });
-
- modelBuilder.Entity("AliasClientDb.Item", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime?>("DeletedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid?>("FolderId")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsDeleted")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ItemType")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<Guid?>("LogoId")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("FolderId");
-
- b.HasIndex("LogoId");
-
- b.ToTable("Items");
- });
-
- modelBuilder.Entity("AliasClientDb.ItemTag", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsDeleted")
- .HasColumnType("INTEGER");
-
- b.Property<Guid>("ItemId")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("TagId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("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<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime?>("FetchedAt")
- .HasColumnType("TEXT");
-
- b.Property<byte[]>("FileData")
- .HasColumnType("BLOB");
-
- b.Property<bool>("IsDeleted")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Source")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Source")
- .IsUnique();
-
- b.ToTable("Logos");
- });
-
- modelBuilder.Entity("AliasClientDb.Passkey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<byte[]>("AdditionalData")
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DisplayName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsDeleted")
- .HasColumnType("INTEGER");
-
- b.Property<Guid>("ItemId")
- .HasColumnType("TEXT");
-
- b.Property<byte[]>("PrfKey")
- .HasMaxLength(64)
- .HasColumnType("BLOB");
-
- b.Property<string>("PrivateKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("RpId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT")
- .UseCollation("NOCASE");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<byte[]>("UserHandle")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.HasKey("Id");
-
- b.HasIndex("ItemId");
-
- b.HasIndex("RpId");
-
- b.ToTable("Passkeys");
- });
-
- modelBuilder.Entity("AliasClientDb.Setting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsDeleted")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("Key");
-
- b.ToTable("Settings");
- });
-
- modelBuilder.Entity("AliasClientDb.Tag", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Color")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("DisplayOrder")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsDeleted")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Name");
-
- b.ToTable("Tags");
- });
-
- modelBuilder.Entity("AliasClientDb.TotpCode", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsDeleted")
- .HasColumnType("INTEGER");
-
- b.Property<Guid>("ItemId")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("SecretKey")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("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
- }
- }
-}
diff --git a/apps/server/Databases/AliasClientDb/Migrations/20260721081936_2.1.0-AddCodecOverflows.cs b/apps/server/Databases/AliasClientDb/Migrations/20260721081936_2.1.0-AddCodecOverflows.cs
deleted file mode 100644
index 1fc7f7cc2..000000000
--- a/apps/server/Databases/AliasClientDb/Migrations/20260721081936_2.1.0-AddCodecOverflows.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// <auto-generated>
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasClientDb.Migrations
-{
- /// <inheritdoc />
- public partial class _210AddCodecOverflows : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.Sql("""
- CREATE TABLE IF NOT EXISTS "CodecOverflows" (
- "Id" TEXT NOT NULL CONSTRAINT "PK_CodecOverflows" PRIMARY KEY,
- "Data" TEXT NOT NULL
- );
- """);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "CodecOverflows");
- }
- }
-}
diff --git a/apps/server/Databases/AliasClientDb/Migrations/20260725190132_2.2.0-ScopeLogosPerManifest.cs b/apps/server/Databases/AliasClientDb/Migrations/20260725190132_2.2.0-ScopeLogosPerManifest.cs
deleted file mode 100644
index 1f55d82b0..000000000
--- a/apps/server/Databases/AliasClientDb/Migrations/20260725190132_2.2.0-ScopeLogosPerManifest.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-// <auto-generated>
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasClientDb.Migrations
-{
- /// <inheritdoc />
- public partial class _220ScopeLogosPerManifest : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropIndex(
- name: "IX_Logos_Source",
- table: "Logos");
-
- migrationBuilder.AddColumn<Guid>(
- name: "SharedFolderId",
- table: "Logos",
- type: "TEXT",
- nullable: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_Logos_SharedFolderId_Source",
- table: "Logos",
- columns: new[] { "SharedFolderId", "Source" },
- unique: true);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropIndex(
- name: "IX_Logos_SharedFolderId_Source",
- table: "Logos");
-
- migrationBuilder.DropColumn(
- name: "SharedFolderId",
- table: "Logos");
-
- migrationBuilder.CreateIndex(
- name: "IX_Logos_Source",
- table: "Logos",
- column: "Source",
- unique: true);
- }
- }
-}
diff --git a/apps/server/Databases/AliasClientDb/Migrations/20260725190132_2.2.0-ScopeLogosPerManifest.Designer.cs b/apps/server/Databases/AliasClientDb/Migrations/20260726141537_2.1.0-CodecOverflowsAndItemIcons.Designer.cs
similarity index 97%
rename from apps/server/Databases/AliasClientDb/Migrations/20260725190132_2.2.0-ScopeLogosPerManifest.Designer.cs
rename to apps/server/Databases/AliasClientDb/Migrations/20260726141537_2.1.0-CodecOverflowsAndItemIcons.Designer.cs
index 41ff4ee15..3a8ab2885 100644
--- a/apps/server/Databases/AliasClientDb/Migrations/20260725190132_2.2.0-ScopeLogosPerManifest.Designer.cs
+++ b/apps/server/Databases/AliasClientDb/Migrations/20260726141537_2.1.0-CodecOverflowsAndItemIcons.Designer.cs
@@ -11,8 +11,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace AliasClientDb.Migrations
{
[DbContext(typeof(AliasClientDbContext))]
- [Migration("20260725190132_2.2.0-ScopeLogosPerManifest")]
- partial class _220ScopeLogosPerManifest
+ [Migration("20260726141537_2.1.0-CodecOverflowsAndItemIcons")]
+ partial class _210CodecOverflowsAndItemIcons
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -364,10 +364,21 @@ namespace AliasClientDb.Migrations
b.Property<bool>("IsDeleted")
.HasColumnType("INTEGER");
+ b.Property<string>("Kind")
+ .IsRequired()
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(20)
+ .HasColumnType("TEXT")
+ .HasDefaultValue("favicon");
+
b.Property<string>("MimeType")
.HasMaxLength(100)
.HasColumnType("TEXT");
+ b.Property<string>("Name")
+ .HasMaxLength(255)
+ .HasColumnType("TEXT");
+
b.Property<Guid?>("SharedFolderId")
.HasColumnType("TEXT");
@@ -381,7 +392,7 @@ namespace AliasClientDb.Migrations
b.HasKey("Id");
- b.HasIndex("SharedFolderId", "Source")
+ b.HasIndex("SharedFolderId", "Kind", "Source")
.IsUnique();
b.ToTable("Logos");
diff --git a/apps/server/Databases/AliasClientDb/Migrations/20260726141537_2.1.0-CodecOverflowsAndItemIcons.cs b/apps/server/Databases/AliasClientDb/Migrations/20260726141537_2.1.0-CodecOverflowsAndItemIcons.cs
new file mode 100644
index 000000000..1001fd1d3
--- /dev/null
+++ b/apps/server/Databases/AliasClientDb/Migrations/20260726141537_2.1.0-CodecOverflowsAndItemIcons.cs
@@ -0,0 +1,88 @@
+// <auto-generated>
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace AliasClientDb.Migrations
+{
+ /// <inheritdoc />
+ public partial class _210CodecOverflowsAndItemIcons : Migration
+ {
+ /// <inheritdoc />
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropIndex(
+ name: "IX_Logos_Source",
+ table: "Logos");
+
+ migrationBuilder.AddColumn<string>(
+ name: "Kind",
+ table: "Logos",
+ type: "TEXT",
+ maxLength: 20,
+ nullable: false,
+ defaultValue: "favicon");
+
+ migrationBuilder.AddColumn<string>(
+ name: "Name",
+ table: "Logos",
+ type: "TEXT",
+ maxLength: 255,
+ nullable: true);
+
+ migrationBuilder.AddColumn<Guid>(
+ name: "SharedFolderId",
+ table: "Logos",
+ type: "TEXT",
+ nullable: true);
+
+ migrationBuilder.CreateTable(
+ name: "CodecOverflows",
+ columns: table => new
+ {
+ Id = table.Column<Guid>(type: "TEXT", nullable: false),
+ Data = table.Column<string>(type: "TEXT", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_CodecOverflows", x => x.Id);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Logos_SharedFolderId_Kind_Source",
+ table: "Logos",
+ columns: new[] { "SharedFolderId", "Kind", "Source" },
+ unique: true);
+ }
+
+ /// <inheritdoc />
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "CodecOverflows");
+
+ migrationBuilder.DropIndex(
+ name: "IX_Logos_SharedFolderId_Kind_Source",
+ table: "Logos");
+
+ migrationBuilder.DropColumn(
+ name: "Kind",
+ table: "Logos");
+
+ migrationBuilder.DropColumn(
+ name: "Name",
+ table: "Logos");
+
+ migrationBuilder.DropColumn(
+ name: "SharedFolderId",
+ table: "Logos");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Logos_Source",
+ table: "Logos",
+ column: "Source",
+ unique: true);
+ }
+ }
+}
diff --git a/apps/server/Databases/AliasClientDb/Migrations/AliasClientDbContextModelSnapshot.cs b/apps/server/Databases/AliasClientDb/Migrations/AliasClientDbContextModelSnapshot.cs
index d5faba397..20c63ba08 100644
--- a/apps/server/Databases/AliasClientDb/Migrations/AliasClientDbContextModelSnapshot.cs
+++ b/apps/server/Databases/AliasClientDb/Migrations/AliasClientDbContextModelSnapshot.cs
@@ -361,10 +361,21 @@ namespace AliasClientDb.Migrations
b.Property<bool>("IsDeleted")
.HasColumnType("INTEGER");
+ b.Property<string>("Kind")
+ .IsRequired()
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(20)
+ .HasColumnType("TEXT")
+ .HasDefaultValue("favicon");
+
b.Property<string>("MimeType")
.HasMaxLength(100)
.HasColumnType("TEXT");
+ b.Property<string>("Name")
+ .HasMaxLength(255)
+ .HasColumnType("TEXT");
+
b.Property<Guid?>("SharedFolderId")
.HasColumnType("TEXT");
@@ -378,7 +389,7 @@ namespace AliasClientDb.Migrations
b.HasKey("Id");
- b.HasIndex("SharedFolderId", "Source")
+ b.HasIndex("SharedFolderId", "Kind", "Source")
.IsUnique();
b.ToTable("Logos");
diff --git a/apps/server/Databases/AliasClientDb/Scripts/MigrationSql/000_FullSchema.sql b/apps/server/Databases/AliasClientDb/Scripts/MigrationSql/000_FullSchema.sql
index b188878bf..b72b64067 100644
--- a/apps/server/Databases/AliasClientDb/Scripts/MigrationSql/000_FullSchema.sql
+++ b/apps/server/Databases/AliasClientDb/Scripts/MigrationSql/000_FullSchema.sql
@@ -1297,25 +1297,23 @@ VALUES ('20260130221620_2.0.0-MajorVersionBump', '10.0.10');
COMMIT;
BEGIN TRANSACTION;
-CREATE TABLE IF NOT EXISTS "CodecOverflows" (
- "Id" TEXT NOT NULL CONSTRAINT "PK_CodecOverflows" PRIMARY KEY,
- "Data" TEXT NOT NULL
-);
+DROP INDEX "IX_Logos_Source";
-INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
-VALUES ('20260721081936_2.1.0-AddCodecOverflows', '10.0.10');
+ALTER TABLE "Logos" ADD "Kind" TEXT NOT NULL DEFAULT 'favicon';
-COMMIT;
-
-BEGIN TRANSACTION;
-DROP INDEX "IX_Logos_Source";
+ALTER TABLE "Logos" ADD "Name" TEXT NULL;
ALTER TABLE "Logos" ADD "SharedFolderId" TEXT NULL;
-CREATE UNIQUE INDEX "IX_Logos_SharedFolderId_Source" ON "Logos" ("SharedFolderId", "Source");
+CREATE TABLE "CodecOverflows" (
+ "Id" TEXT NOT NULL CONSTRAINT "PK_CodecOverflows" PRIMARY KEY,
+ "Data" TEXT NOT NULL
+);
+
+CREATE UNIQUE INDEX "IX_Logos_SharedFolderId_Kind_Source" ON "Logos" ("SharedFolderId", "Kind", "Source");
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
-VALUES ('20260725190132_2.2.0-ScopeLogosPerManifest', '10.0.10');
+VALUES ('20260726141537_2.1.0-CodecOverflowsAndItemIcons', '10.0.10');
COMMIT;