Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Squash server DB EF migrations (#2159)
Leendert de Borstad91c9e56ab0
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedIdentityTablesAndWidenAuthLogPath.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedSchemaAndWidenAuthLogPath.Designer.cssimilarity index 99%rename from apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedIdentityTablesAndWidenAuthLogPath.Designer.csrename to apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedSchemaAndWidenAuthLogPath.Designer.csindex 360ac9c71..3115915f2 100644--- a/apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedIdentityTablesAndWidenAuthLogPath.Designer.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedSchemaAndWidenAuthLogPath.Designer.cs@@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;namespace AliasServerDb.Migrations{[DbContext(typeof(AliasServerDbContext))]- [Migration("20260810084712_DropUnusedIdentityTablesAndWidenAuthLogPath")]- partial class DropUnusedIdentityTablesAndWidenAuthLogPath+ [Migration("20260810084712_DropUnusedSchemaAndWidenAuthLogPath")]+ partial class DropUnusedSchemaAndWidenAuthLogPath{/// <inheritdoc />protected override void BuildTargetModel(ModelBuilder modelBuilder)@@ -839,11 +839,6 @@ namespace AliasServerDb.Migrations.HasMaxLength(50).HasColumnType("character varying(50)");- b.Property<string>("DesiredStatus")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-b.Property<DateTime>("Heartbeat").HasColumnType("timestamp with time zone");diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedIdentityTablesAndWidenAuthLogPath.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedSchemaAndWidenAuthLogPath.cssimilarity index 87%rename from apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedIdentityTablesAndWidenAuthLogPath.csrename to apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedSchemaAndWidenAuthLogPath.csindex 429d9efec..29c27c969 100644--- a/apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedIdentityTablesAndWidenAuthLogPath.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedSchemaAndWidenAuthLogPath.cs@@ -6,10 +6,10 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;namespace AliasServerDb.Migrations{/// <summary>- /// Drops the ASP.NET Identity tables that AliasVault does not use, and widens the audit log request path so the- /// longer v2 API routes still fit.+ /// Drops the ASP.NET Identity tables and the worker service column that AliasVault does not use, and widens the+ /// audit log request path so the longer v2 API routes still fit./// </summary>- public partial class DropUnusedIdentityTablesAndWidenAuthLogPath : Migration+ public partial class DropUnusedSchemaAndWidenAuthLogPath : Migration{/// <inheritdoc />protected override void Up(MigrationBuilder migrationBuilder)@@ -29,6 +29,10 @@ namespace AliasServerDb.MigrationsmigrationBuilder.DropTable(name: "UserRoles");+ migrationBuilder.DropColumn(+ name: "DesiredStatus",+ table: "WorkerServiceStatuses");+migrationBuilder.AlterColumn<string>(name: "RequestPath",table: "AuthLogs",@@ -55,6 +59,14 @@ namespace AliasServerDb.MigrationsoldMaxLength: 255,oldNullable: true);+ migrationBuilder.AddColumn<string>(+ name: "DesiredStatus",+ table: "WorkerServiceStatuses",+ type: "character varying(50)",+ maxLength: 50,+ nullable: false,+ defaultValue: "");+migrationBuilder.CreateTable(name: "AdminRoles",columns: table => newdiff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.csindex 50294bca0..42eece32a 100644--- a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.cs@@ -671,6 +671,11 @@ namespace AliasServerDb.Migrationsb.Property<string>("Id").HasColumnType("text");+ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");+b.Property<DateTime?>("ClearedAt").HasColumnType("timestamp with time zone");@@ -837,6 +842,11 @@ namespace AliasServerDb.Migrationsb.Property<int>("AccountKeyVersion").HasColumnType("integer");+ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");+b.Property<DateTime>("CreatedAt").HasColumnType("timestamp with time zone");@@ -925,16 +935,78 @@ namespace AliasServerDb.Migrationsb.ToTable("UserUnlockKeys");});+ modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<int>("AccountKeyVersion")+ .HasColumnType("integer");++ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");++ b.Property<DateTime>("ArchivedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("ArchivedByClient")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("EncryptedAccountKey")+ .IsRequired()+ .HasColumnType("text");++ b.Property<string>("Label")+ .IsRequired()+ .HasMaxLength(100)+ .HasColumnType("character varying(100)");++ b.Property<string>("Metadata")+ .HasColumnType("jsonb");++ b.Property<string>("Type")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");++ b.Property<Guid>("UnlockKeyId")+ .HasColumnType("uuid");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("UserId")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.HasKey("Id");++ b.HasIndex("ArchivedAt")+ .HasDatabaseName("IX_UserUnlockKeysHistory_ArchivedAt");++ b.HasIndex("UserId", "Type", "ArchivedAt")+ .HasDatabaseName("IX_UserUnlockKeysHistory_UserId_Type_ArchivedAt");++ b.ToTable("UserUnlockKeysHistory", (string)null);+ });+modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>{+ b.Property<Guid>("ManifestId")+ .HasColumnType("uuid");+b.Property<string>("Hash").HasMaxLength(64).HasColumnType("character varying(64)");- b.Property<string>("OwnerUserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-b.Property<string>("Category").IsRequired().HasMaxLength(20)@@ -950,15 +1022,10 @@ namespace AliasServerDb.Migrationsb.Property<int>("KeyVersion").HasColumnType("integer");- b.Property<DateTime>("LastReferencedAt")- .HasColumnType("timestamp with time zone");-b.Property<int>("SizeBytes").HasColumnType("integer");- b.HasKey("Hash", "OwnerUserId");-- b.HasIndex("OwnerUserId", "Category");+ b.HasKey("ManifestId", "Hash");b.ToTable("VaultBlobObjects");});@@ -1191,6 +1258,11 @@ namespace AliasServerDb.Migrations.ValueGeneratedOnAdd().HasColumnType("uuid");+ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");+b.Property<DateTime>("CreatedAt").HasColumnType("timestamp with time zone");@@ -1301,11 +1373,6 @@ namespace AliasServerDb.Migrations.HasMaxLength(50).HasColumnType("character varying(50)");- b.Property<string>("DesiredStatus")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-b.Property<DateTime>("Heartbeat").HasColumnType("timestamp with time zone");@@ -1548,17 +1615,28 @@ namespace AliasServerDb.Migrationsb.Navigation("User");});- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>+ modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>{b.HasOne("AliasServerDb.AliasVaultUser", "User").WithMany()- .HasForeignKey("OwnerUserId")+ .HasForeignKey("UserId").OnDelete(DeleteBehavior.Cascade).IsRequired();b.Navigation("User");});+ modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>+ {+ b.HasOne("AliasServerDb.VaultManifest", "Manifest")+ .WithMany()+ .HasForeignKey("ManifestId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("Manifest");+ });+modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>{b.HasOne("AliasServerDb.VaultManifest", "Manifest")diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.csindex 00d673d10..e0121c9fc 100644--- a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.cs@@ -12,9 +12,10 @@ namespace AliasServerDb.Migrations/// - every user gains a Personal group that takes over their vault, aliases, quotas and rate limit overrides,/// - the append-only "Vaults" revision log becomes one "VaultManifests" head row per user plus a/// "VaultManifestsHistory" tail, keyed by a newly generated manifest id,- /// - per-user email encryption keys become per-manifest delivery keys.+ /// - per-user email encryption keys become per-manifest delivery keys,+ /// - every stored public key records the algorithm it belongs to.///- /// The tables that only the manifest-v1 write path uses (buckets, blobs, access and unlock keys) start empty. Every+ /// The tables that only the manifest-v1 write path uses (buckets, blobs, grant, access and unlock keys) start empty. Every/// ciphertext they hold carries the version of the key it was written with, so a future key rotation can tell the/// generations apart./// </summary>@@ -27,6 +28,7 @@ namespace AliasServerDb.MigrationsConvertVaultsToManifests(migrationBuilder);ScopeEmailClaimsToManifests(migrationBuilder);ScopeDeliveryKeysToManifests(migrationBuilder);+ AddAlgorithmToPublicKeys(migrationBuilder);ScopeRateLimitsToGroups(migrationBuilder);AddManifestV1Tables(migrationBuilder);SkipToastCompressionOnCiphertextColumns(migrationBuilder);@@ -37,6 +39,7 @@ namespace AliasServerDb.Migrations{DropManifestV1Tables(migrationBuilder);RestoreRateLimitsToUsers(migrationBuilder);+ RemoveAlgorithmFromPublicKeys(migrationBuilder);RestoreDeliveryKeysToUsers(migrationBuilder);RestoreEmailClaimsToUsers(migrationBuilder);RestoreManifestsToVaults(migrationBuilder);@@ -382,6 +385,24 @@ namespace AliasServerDb.MigrationsonDelete: ReferentialAction.Cascade);}+ /// <summary>+ /// Records the algorithm on the public keys that predate the column. All of them are RSA-OAEP keys.+ /// </summary>+ /// <param name="migrationBuilder">Migration builder.</param>+ private static void AddAlgorithmToPublicKeys(MigrationBuilder migrationBuilder)+ {+ migrationBuilder.AddColumn<string>(name: "Algorithm", table: "VaultManifestDeliveryKeys", type: "character varying(30)", maxLength: 30, nullable: true);+ migrationBuilder.AddColumn<string>(name: "Algorithm", table: "MobileLoginRequests", type: "character varying(30)", maxLength: 30, nullable: true);++ migrationBuilder.Sql("""+ UPDATE "VaultManifestDeliveryKeys" SET "Algorithm" = 'rsa-oaep-sha256';+ UPDATE "MobileLoginRequests" SET "Algorithm" = 'rsa-oaep-sha256';+ """);++ migrationBuilder.AlterColumn<string>(name: "Algorithm", table: "VaultManifestDeliveryKeys", type: "character varying(30)", maxLength: 30, nullable: false, oldClrType: typeof(string), oldType: "character varying(30)", oldMaxLength: 30, oldNullable: true);+ migrationBuilder.AlterColumn<string>(name: "Algorithm", table: "MobileLoginRequests", type: "character varying(30)", maxLength: 30, nullable: false, oldClrType: typeof(string), oldType: "character varying(30)", oldMaxLength: 30, oldNullable: true);+ }+/// <summary>/// Charges rate limit overrides to the group that owns the content instead of to the user./// </summary>@@ -424,6 +445,7 @@ namespace AliasServerDb.Migrations{Id = table.Column<Guid>(type: "uuid", nullable: false),UserId = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),+ Algorithm = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),PublicKey = table.Column<string>(type: "character varying(2000)", maxLength: 2000, nullable: false),EncryptedPrivateKey = table.Column<string>(type: "character varying(4000)", maxLength: 4000, nullable: false),AccountKeyVersion = table.Column<int>(type: "integer", nullable: false, defaultValue: 0),@@ -469,6 +491,35 @@ namespace AliasServerDb.MigrationsonDelete: ReferentialAction.Cascade);});+ migrationBuilder.CreateTable(+ name: "UserUnlockKeysHistory",+ columns: table => new+ {+ Id = table.Column<Guid>(type: "uuid", nullable: false),+ UnlockKeyId = table.Column<Guid>(type: "uuid", nullable: false),+ UserId = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),+ Type = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),+ Algorithm = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),+ Label = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),+ EncryptedAccountKey = table.Column<string>(type: "text", nullable: false),+ AccountKeyVersion = table.Column<int>(type: "integer", nullable: false),+ Metadata = table.Column<string>(type: "jsonb", nullable: true),+ CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),+ UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),+ ArchivedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),+ ArchivedByClient = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true)+ },+ constraints: table =>+ {+ table.PrimaryKey("PK_UserUnlockKeysHistory", x => x.Id);+ table.ForeignKey(+ name: "FK_UserUnlockKeysHistory_AliasVaultUsers_UserId",+ column: x => x.UserId,+ principalTable: "AliasVaultUsers",+ principalColumn: "Id",+ onDelete: ReferentialAction.Cascade);+ });+migrationBuilder.CreateTable(name: "VaultManifestAccessKeys",columns: table => new@@ -508,23 +559,22 @@ namespace AliasServerDb.Migrationsname: "VaultBlobObjects",columns: table => new{+ ManifestId = table.Column<Guid>(type: "uuid", nullable: false),Hash = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),- OwnerUserId = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),Category = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),EncryptedData = table.Column<byte[]>(type: "bytea", nullable: false),SizeBytes = table.Column<int>(type: "integer", nullable: false),KeyVersion = table.Column<int>(type: "integer", nullable: false, defaultValue: 0),- CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),- LastReferencedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)+ CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)},constraints: table =>{- table.PrimaryKey("PK_VaultBlobObjects", x => new { x.Hash, x.OwnerUserId });+ table.PrimaryKey("PK_VaultBlobObjects", x => new { x.ManifestId, x.Hash });table.ForeignKey(- name: "FK_VaultBlobObjects_AliasVaultUsers_OwnerUserId",- column: x => x.OwnerUserId,- principalTable: "AliasVaultUsers",- principalColumn: "Id",+ name: "FK_VaultBlobObjects_VaultManifests_ManifestId",+ column: x => x.ManifestId,+ principalTable: "VaultManifests",+ principalColumn: "ManifestId",onDelete: ReferentialAction.Cascade);});@@ -597,10 +647,11 @@ namespace AliasServerDb.MigrationsmigrationBuilder.CreateIndex(name: "UX_UserGrantKeys_User_Primary", table: "UserGrantKeys", column: "UserId", unique: true, filter: "\"IsPrimary\"");migrationBuilder.CreateIndex(name: "UX_UserUnlockKeys_UserId_Type_Label", table: "UserUnlockKeys", columns: new[] { "UserId", "Type", "Label" }, unique: true);+ migrationBuilder.CreateIndex(name: "IX_UserUnlockKeysHistory_ArchivedAt", table: "UserUnlockKeysHistory", column: "ArchivedAt");+ migrationBuilder.CreateIndex(name: "IX_UserUnlockKeysHistory_UserId_Type_ArchivedAt", table: "UserUnlockKeysHistory", columns: new[] { "UserId", "Type", "ArchivedAt" });migrationBuilder.CreateIndex(name: "IX_VaultManifestAccessKeys_UserGrantKeyId", table: "VaultManifestAccessKeys", column: "UserGrantKeyId");migrationBuilder.CreateIndex(name: "IX_VaultManifestAccessKeys_VaultManifestId", table: "VaultManifestAccessKeys", column: "VaultManifestId");migrationBuilder.CreateIndex(name: "UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version", table: "VaultManifestAccessKeys", columns: new[] { "UserId", "Type", "VaultManifestId", "KeyVersion" }, unique: true);- migrationBuilder.CreateIndex(name: "IX_VaultBlobObjects_OwnerUserId_Category", table: "VaultBlobObjects", columns: new[] { "OwnerUserId", "Category" });}/// <summary>@@ -631,6 +682,7 @@ namespace AliasServerDb.MigrationsmigrationBuilder.DropTable(name: "VaultBlobReferences");migrationBuilder.DropTable(name: "VaultBlobObjects");migrationBuilder.DropTable(name: "VaultManifestAccessKeys");+ migrationBuilder.DropTable(name: "UserUnlockKeysHistory");migrationBuilder.DropTable(name: "UserUnlockKeys");migrationBuilder.DropTable(name: "UserGrantKeys");}@@ -667,6 +719,16 @@ namespace AliasServerDb.MigrationsonDelete: ReferentialAction.Cascade);}+ /// <summary>+ /// Drops the algorithm from the public keys that predate the column.+ /// </summary>+ /// <param name="migrationBuilder">Migration builder.</param>+ private static void RemoveAlgorithmFromPublicKeys(MigrationBuilder migrationBuilder)+ {+ migrationBuilder.DropColumn(name: "Algorithm", table: "MobileLoginRequests");+ migrationBuilder.DropColumn(name: "Algorithm", table: "VaultManifestDeliveryKeys");+ }+/// <summary>/// Turns the per-manifest delivery keys back into per-user email encryption keys./// </summary>diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810154523_EmailMultiManifestAndStorageV2.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810154523_EmailMultiManifestAndStorageV2.Designer.csindex 51274ed17..00de722b5 100644--- a/apps/server/Databases/AliasServerDb/Migrations/20260810154523_EmailMultiManifestAndStorageV2.Designer.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/20260810154523_EmailMultiManifestAndStorageV2.Designer.cs@@ -696,6 +696,11 @@ namespace AliasServerDb.Migrationsb.Property<string>("Id").HasColumnType("text");+ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");+b.Property<DateTime?>("ClearedAt").HasColumnType("timestamp with time zone");@@ -862,6 +867,11 @@ namespace AliasServerDb.Migrationsb.Property<int>("AccountKeyVersion").HasColumnType("integer");+ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");+b.Property<DateTime>("CreatedAt").HasColumnType("timestamp with time zone");@@ -950,16 +960,78 @@ namespace AliasServerDb.Migrationsb.ToTable("UserUnlockKeys");});+ modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<int>("AccountKeyVersion")+ .HasColumnType("integer");++ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");++ b.Property<DateTime>("ArchivedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("ArchivedByClient")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("EncryptedAccountKey")+ .IsRequired()+ .HasColumnType("text");++ b.Property<string>("Label")+ .IsRequired()+ .HasMaxLength(100)+ .HasColumnType("character varying(100)");++ b.Property<string>("Metadata")+ .HasColumnType("jsonb");++ b.Property<string>("Type")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");++ b.Property<Guid>("UnlockKeyId")+ .HasColumnType("uuid");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("UserId")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.HasKey("Id");++ b.HasIndex("ArchivedAt")+ .HasDatabaseName("IX_UserUnlockKeysHistory_ArchivedAt");++ b.HasIndex("UserId", "Type", "ArchivedAt")+ .HasDatabaseName("IX_UserUnlockKeysHistory_UserId_Type_ArchivedAt");++ b.ToTable("UserUnlockKeysHistory", (string)null);+ });+modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>{+ b.Property<Guid>("ManifestId")+ .HasColumnType("uuid");+b.Property<string>("Hash").HasMaxLength(64).HasColumnType("character varying(64)");- b.Property<string>("OwnerUserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-b.Property<string>("Category").IsRequired().HasMaxLength(20)@@ -975,15 +1047,10 @@ namespace AliasServerDb.Migrationsb.Property<int>("KeyVersion").HasColumnType("integer");- b.Property<DateTime>("LastReferencedAt")- .HasColumnType("timestamp with time zone");-b.Property<int>("SizeBytes").HasColumnType("integer");- b.HasKey("Hash", "OwnerUserId");-- b.HasIndex("OwnerUserId", "Category");+ b.HasKey("ManifestId", "Hash");b.ToTable("VaultBlobObjects");});@@ -1216,6 +1283,11 @@ namespace AliasServerDb.Migrations.ValueGeneratedOnAdd().HasColumnType("uuid");+ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");+b.Property<DateTime>("CreatedAt").HasColumnType("timestamp with time zone");@@ -1326,11 +1398,6 @@ namespace AliasServerDb.Migrations.HasMaxLength(50).HasColumnType("character varying(50)");- b.Property<string>("DesiredStatus")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-b.Property<DateTime>("Heartbeat").HasColumnType("timestamp with time zone");@@ -1548,17 +1615,28 @@ namespace AliasServerDb.Migrationsb.Navigation("User");});- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>+ modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>{b.HasOne("AliasServerDb.AliasVaultUser", "User").WithMany()- .HasForeignKey("OwnerUserId")+ .HasForeignKey("UserId").OnDelete(DeleteBehavior.Cascade).IsRequired();b.Navigation("User");});+ modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>+ {+ b.HasOne("AliasServerDb.VaultManifest", "Manifest")+ .WithMany()+ .HasForeignKey("ManifestId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("Manifest");+ });+modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>{b.HasOne("AliasServerDb.VaultManifest", "Manifest")diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.Designer.csindex 971bc6896..57147d1c7 100644--- a/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.Designer.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.Designer.cs@@ -696,6 +696,11 @@ namespace AliasServerDb.Migrationsb.Property<string>("Id").HasColumnType("text");+ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");+b.Property<DateTime?>("ClearedAt").HasColumnType("timestamp with time zone");@@ -862,6 +867,11 @@ namespace AliasServerDb.Migrationsb.Property<int>("AccountKeyVersion").HasColumnType("integer");+ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");+b.Property<DateTime>("CreatedAt").HasColumnType("timestamp with time zone");@@ -950,16 +960,78 @@ namespace AliasServerDb.Migrationsb.ToTable("UserUnlockKeys");});+ modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<int>("AccountKeyVersion")+ .HasColumnType("integer");++ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");++ b.Property<DateTime>("ArchivedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("ArchivedByClient")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("EncryptedAccountKey")+ .IsRequired()+ .HasColumnType("text");++ b.Property<string>("Label")+ .IsRequired()+ .HasMaxLength(100)+ .HasColumnType("character varying(100)");++ b.Property<string>("Metadata")+ .HasColumnType("jsonb");++ b.Property<string>("Type")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");++ b.Property<Guid>("UnlockKeyId")+ .HasColumnType("uuid");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("UserId")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.HasKey("Id");++ b.HasIndex("ArchivedAt")+ .HasDatabaseName("IX_UserUnlockKeysHistory_ArchivedAt");++ b.HasIndex("UserId", "Type", "ArchivedAt")+ .HasDatabaseName("IX_UserUnlockKeysHistory_UserId_Type_ArchivedAt");++ b.ToTable("UserUnlockKeysHistory", (string)null);+ });+modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>{+ b.Property<Guid>("ManifestId")+ .HasColumnType("uuid");+b.Property<string>("Hash").HasMaxLength(64).HasColumnType("character varying(64)");- b.Property<string>("OwnerUserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-b.Property<string>("Category").IsRequired().HasMaxLength(20)@@ -975,15 +1047,10 @@ namespace AliasServerDb.Migrationsb.Property<int>("KeyVersion").HasColumnType("integer");- b.Property<DateTime>("LastReferencedAt")- .HasColumnType("timestamp with time zone");-b.Property<int>("SizeBytes").HasColumnType("integer");- b.HasKey("Hash", "OwnerUserId");-- b.HasIndex("OwnerUserId", "Category");+ b.HasKey("ManifestId", "Hash");b.ToTable("VaultBlobObjects");});@@ -1216,6 +1283,11 @@ namespace AliasServerDb.Migrations.ValueGeneratedOnAdd().HasColumnType("uuid");+ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");+b.Property<DateTime>("CreatedAt").HasColumnType("timestamp with time zone");@@ -1326,11 +1398,6 @@ namespace AliasServerDb.Migrations.HasMaxLength(50).HasColumnType("character varying(50)");- b.Property<string>("DesiredStatus")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-b.Property<DateTime>("Heartbeat").HasColumnType("timestamp with time zone");@@ -1548,17 +1615,28 @@ namespace AliasServerDb.Migrationsb.Navigation("User");});- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>+ modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>{b.HasOne("AliasServerDb.AliasVaultUser", "User").WithMany()- .HasForeignKey("OwnerUserId")+ .HasForeignKey("UserId").OnDelete(DeleteBehavior.Cascade).IsRequired();b.Navigation("User");});+ modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>+ {+ b.HasOne("AliasServerDb.VaultManifest", "Manifest")+ .WithMany()+ .HasForeignKey("ManifestId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("Manifest");+ });+modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>{b.HasOne("AliasServerDb.VaultManifest", "Manifest")diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.cs b/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.csindex 5292a0cac..df2fa457a 100644--- a/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.cs@@ -60,7 +60,8 @@ namespace AliasServerDb.MigrationsALTER TABLE "RateLimits" DROP CONSTRAINT "FK_RateLimits_Groups_GroupId";ALTER TABLE "UserGrantKeys" DROP CONSTRAINT "FK_UserGrantKeys_AliasVaultUsers_UserId";ALTER TABLE "UserUnlockKeys" DROP CONSTRAINT "FK_UserUnlockKeys_AliasVaultUsers_UserId";- ALTER TABLE "VaultBlobObjects" DROP CONSTRAINT "FK_VaultBlobObjects_AliasVaultUsers_OwnerUserId";+ ALTER TABLE "UserUnlockKeysHistory" DROP CONSTRAINT "FK_UserUnlockKeysHistory_AliasVaultUsers_UserId";+ ALTER TABLE "VaultBlobObjects" DROP CONSTRAINT "FK_VaultBlobObjects_VaultManifests_ManifestId";ALTER TABLE "VaultBlobReferences" DROP CONSTRAINT "FK_VaultBlobReferences_VaultManifests_ManifestId";ALTER TABLE "VaultDataBuckets" DROP CONSTRAINT "FK_VaultDataBuckets_VaultManifests_ManifestId";ALTER TABLE "VaultManifestAccessKeys" DROP CONSTRAINT "FK_VaultManifestAccessKeys_AliasVaultUsers_UserId";@@ -314,8 +315,8 @@ namespace AliasServerDb.Migrations}/// <summary>- /// Moves the manifest a delivery key belongs to up to the second column instead of leaving it behind the- /// timestamps.+ /// Moves the manifest a delivery key belongs to and its algorithm up next to the primary key instead of+ /// leaving them behind the timestamps./// </summary>/// <param name="migrationBuilder">Migration builder.</param>private static void RebuildVaultManifestDeliveryKeys(MigrationBuilder migrationBuilder)@@ -324,14 +325,15 @@ namespace AliasServerDb.MigrationsCREATE TABLE "VaultManifestDeliveryKeys_reordered" ("Id" uuid NOT NULL,"VaultManifestId" uuid NOT NULL,+ "Algorithm" character varying(30) NOT NULL,"PublicKey" character varying(2000) NOT NULL,"IsPrimary" boolean NOT NULL,"CreatedAt" timestamp with time zone NOT NULL,"UpdatedAt" timestamp with time zone NOT NULL);- INSERT INTO "VaultManifestDeliveryKeys_reordered" ("Id", "VaultManifestId", "PublicKey", "IsPrimary", "CreatedAt", "UpdatedAt")- SELECT "Id", "VaultManifestId", "PublicKey", "IsPrimary", "CreatedAt", "UpdatedAt"+ INSERT INTO "VaultManifestDeliveryKeys_reordered" ("Id", "VaultManifestId", "Algorithm", "PublicKey", "IsPrimary", "CreatedAt", "UpdatedAt")+ SELECT "Id", "VaultManifestId", "Algorithm", "PublicKey", "IsPrimary", "CreatedAt", "UpdatedAt"FROM "VaultManifestDeliveryKeys";DROP TABLE "VaultManifestDeliveryKeys";@@ -364,7 +366,8 @@ namespace AliasServerDb.MigrationsALTER TABLE "RateLimits" ADD CONSTRAINT "FK_RateLimits_Groups_GroupId" FOREIGN KEY ("GroupId") REFERENCES "Groups"("Id") ON DELETE CASCADE;ALTER TABLE "UserGrantKeys" ADD CONSTRAINT "FK_UserGrantKeys_AliasVaultUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AliasVaultUsers"("Id") ON DELETE CASCADE;ALTER TABLE "UserUnlockKeys" ADD CONSTRAINT "FK_UserUnlockKeys_AliasVaultUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AliasVaultUsers"("Id") ON DELETE CASCADE;- ALTER TABLE "VaultBlobObjects" ADD CONSTRAINT "FK_VaultBlobObjects_AliasVaultUsers_OwnerUserId" FOREIGN KEY ("OwnerUserId") REFERENCES "AliasVaultUsers"("Id") ON DELETE CASCADE;+ ALTER TABLE "UserUnlockKeysHistory" ADD CONSTRAINT "FK_UserUnlockKeysHistory_AliasVaultUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AliasVaultUsers"("Id") ON DELETE CASCADE;+ ALTER TABLE "VaultBlobObjects" ADD CONSTRAINT "FK_VaultBlobObjects_VaultManifests_ManifestId" FOREIGN KEY ("ManifestId") REFERENCES "VaultManifests"("ManifestId") ON DELETE CASCADE;ALTER TABLE "VaultBlobReferences" ADD CONSTRAINT "FK_VaultBlobReferences_VaultManifests_ManifestId" FOREIGN KEY ("ManifestId") REFERENCES "VaultManifests"("ManifestId") ON DELETE CASCADE;ALTER TABLE "VaultDataBuckets" ADD CONSTRAINT "FK_VaultDataBuckets_VaultManifests_ManifestId" FOREIGN KEY ("ManifestId") REFERENCES "VaultManifests"("ManifestId") ON DELETE CASCADE;ALTER TABLE "VaultManifestAccessKeys" ADD CONSTRAINT "FK_VaultManifestAccessKeys_AliasVaultUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AliasVaultUsers"("Id") ON DELETE CASCADE;diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.csindex 5b571466f..3287151d4 100644--- a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs@@ -881,6 +881,11 @@ namespace AliasServerDb.Migrationsb.Property<string>("Id").HasColumnType("text");+ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");+b.Property<DateTime?>("ClearedAt").HasColumnType("timestamp with time zone");@@ -1047,6 +1052,11 @@ namespace AliasServerDb.Migrationsb.Property<int>("AccountKeyVersion").HasColumnType("integer");+ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");+b.Property<DateTime>("CreatedAt").HasColumnType("timestamp with time zone");@@ -1135,16 +1145,78 @@ namespace AliasServerDb.Migrationsb.ToTable("UserUnlockKeys");});+ modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<int>("AccountKeyVersion")+ .HasColumnType("integer");++ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");++ b.Property<DateTime>("ArchivedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("ArchivedByClient")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("EncryptedAccountKey")+ .IsRequired()+ .HasColumnType("text");++ b.Property<string>("Label")+ .IsRequired()+ .HasMaxLength(100)+ .HasColumnType("character varying(100)");++ b.Property<string>("Metadata")+ .HasColumnType("jsonb");++ b.Property<string>("Type")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");++ b.Property<Guid>("UnlockKeyId")+ .HasColumnType("uuid");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("UserId")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.HasKey("Id");++ b.HasIndex("ArchivedAt")+ .HasDatabaseName("IX_UserUnlockKeysHistory_ArchivedAt");++ b.HasIndex("UserId", "Type", "ArchivedAt")+ .HasDatabaseName("IX_UserUnlockKeysHistory_UserId_Type_ArchivedAt");++ b.ToTable("UserUnlockKeysHistory", (string)null);+ });+modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>{+ b.Property<Guid>("ManifestId")+ .HasColumnType("uuid");+b.Property<string>("Hash").HasMaxLength(64).HasColumnType("character varying(64)");- b.Property<string>("OwnerUserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-b.Property<string>("Category").IsRequired().HasMaxLength(20)@@ -1160,15 +1232,10 @@ namespace AliasServerDb.Migrationsb.Property<int>("KeyVersion").HasColumnType("integer");- b.Property<DateTime>("LastReferencedAt")- .HasColumnType("timestamp with time zone");-b.Property<int>("SizeBytes").HasColumnType("integer");- b.HasKey("Hash", "OwnerUserId");-- b.HasIndex("OwnerUserId", "Category");+ b.HasKey("ManifestId", "Hash");b.ToTable("VaultBlobObjects");});@@ -1401,6 +1468,11 @@ namespace AliasServerDb.Migrations.ValueGeneratedOnAdd().HasColumnType("uuid");+ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");+b.Property<DateTime>("CreatedAt").HasColumnType("timestamp with time zone");@@ -1511,11 +1583,6 @@ namespace AliasServerDb.Migrations.HasMaxLength(50).HasColumnType("character varying(50)");- b.Property<string>("DesiredStatus")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-b.Property<DateTime>("Heartbeat").HasColumnType("timestamp with time zone");@@ -1801,17 +1868,28 @@ namespace AliasServerDb.Migrationsb.Navigation("User");});- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>+ modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>{b.HasOne("AliasServerDb.AliasVaultUser", "User").WithMany()- .HasForeignKey("OwnerUserId")+ .HasForeignKey("UserId").OnDelete(DeleteBehavior.Cascade).IsRequired();b.Navigation("User");});+ modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>+ {+ b.HasOne("AliasServerDb.VaultManifest", "Manifest")+ .WithMany()+ .HasForeignKey("ManifestId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("Manifest");+ });+modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>{b.HasOne("AliasServerDb.VaultManifest", "Manifest")diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260826154135_AddAlgorithmToPublicKeyTables.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260826154135_AddAlgorithmToPublicKeyTables.Designer.csdeleted file mode 100644index 005a333df..000000000--- a/apps/server/Databases/AliasServerDb/Migrations/20260826154135_AddAlgorithmToPublicKeyTables.Designer.cs+++ /dev/null@@ -1,1945 +0,0 @@-// <auto-generated />-using System;-using AliasServerDb;-using Microsoft.EntityFrameworkCore;-using Microsoft.EntityFrameworkCore.Infrastructure;-using Microsoft.EntityFrameworkCore.Migrations;-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;--#nullable disable--namespace AliasServerDb.Migrations-{- [DbContext(typeof(AliasServerDbContext))]- [Migration("20260826154135_AddAlgorithmToPublicKeyTables")]- partial class AddAlgorithmToPublicKeyTables- {- /// <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)- .HasAnnotation("Relational:MaxIdentifierLength", 63);-- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);-- modelBuilder.Entity("AliasServerDb.AdminUser", b =>- {- b.Property<string>("Id")- .HasColumnType("text");-- b.Property<int>("AccessFailedCount")- .HasColumnType("integer");-- b.Property<string>("ConcurrencyStamp")- .HasColumnType("text");-- b.Property<string>("Email")- .HasColumnType("text");-- b.Property<bool>("EmailConfirmed")- .HasColumnType("boolean");-- b.Property<DateTime?>("LastPasswordChanged")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("LockoutEnabled")- .HasColumnType("boolean");-- b.Property<DateTimeOffset?>("LockoutEnd")- .HasColumnType("timestamp with time zone");-- b.Property<string>("NormalizedEmail")- .HasColumnType("text");-- b.Property<string>("NormalizedUserName")- .HasColumnType("text");-- b.Property<string>("PasswordHash")- .HasColumnType("text");-- b.Property<string>("PhoneNumber")- .HasColumnType("text");-- b.Property<bool>("PhoneNumberConfirmed")- .HasColumnType("boolean");-- b.Property<string>("SecurityStamp")- .HasColumnType("text");-- b.Property<bool>("TwoFactorEnabled")- .HasColumnType("boolean");-- b.Property<string>("UserName")- .HasColumnType("text");-- b.HasKey("Id");-- b.ToTable("AdminUsers");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>- {- b.Property<string>("Id")- .HasColumnType("text");-- b.Property<int>("AccessFailedCount")- .HasColumnType("integer");-- b.Property<bool>("Blocked")- .HasColumnType("boolean");-- b.Property<DateTime?>("BlockedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ConcurrencyStamp")- .HasColumnType("text");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Email")- .HasColumnType("text");-- b.Property<bool>("EmailConfirmed")- .HasColumnType("boolean");-- b.Property<DateTime?>("LastActivityDate")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("LockoutEnabled")- .HasColumnType("boolean");-- b.Property<DateTimeOffset?>("LockoutEnd")- .HasColumnType("timestamp with time zone");-- b.Property<string>("NormalizedEmail")- .HasColumnType("text");-- b.Property<string>("NormalizedUserName")- .HasColumnType("text");-- b.Property<DateTime>("PasswordChangedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("PasswordHash")- .HasColumnType("text");-- b.Property<Guid>("PersonalGroupId")- .HasColumnType("uuid");-- b.Property<string>("PhoneNumber")- .HasColumnType("text");-- b.Property<bool>("PhoneNumberConfirmed")- .HasColumnType("boolean");-- b.Property<string>("SecurityStamp")- .HasColumnType("text");-- b.Property<string>("SrpIdentity")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("TwoFactorEnabled")- .HasColumnType("boolean");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserName")- .HasColumnType("text");-- b.HasKey("Id");-- b.HasIndex("PersonalGroupId")- .IsUnique()- .HasDatabaseName("UX_AliasVaultUsers_PersonalGroupId");-- b.ToTable("AliasVaultUsers");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("DeviceIdentifier")- .IsRequired()- .HasColumnType("text");-- b.Property<DateTime>("ExpireDate")- .HasMaxLength(255)- .HasColumnType("timestamp with time zone");-- b.Property<string>("IpAddress")- .HasMaxLength(45)- .HasColumnType("character varying(45)");-- b.Property<string>("PreviousTokenValue")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Value")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId");-- b.ToTable("AliasVaultUserRefreshTokens");- });-- modelBuilder.Entity("AliasServerDb.AuthLog", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("AdditionalInfo")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Browser")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("Client")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("Country")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("DeviceType")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<int>("EventType")- .HasColumnType("integer");-- b.Property<int?>("FailureReason")- .HasColumnType("integer");-- b.Property<string>("IpAddress")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<bool>("IsSuccess")- .HasColumnType("boolean");-- b.Property<bool>("IsSuspiciousActivity")- .HasColumnType("boolean");-- b.Property<string>("OperatingSystem")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("RequestPath")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("Timestamp")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Username")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex(new[] { "EventType" }, "IX_EventType");-- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");-- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");-- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")- .IsDescending(false, false, true);-- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")- .IsDescending(false, true);-- b.ToTable("AuthLogs");- });-- modelBuilder.Entity("AliasServerDb.BlockedIpRange", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<bool>("BlockLogin")- .HasColumnType("boolean");-- b.Property<bool>("BlockRegistration")- .HasColumnType("boolean");-- b.Property<bool>("BlockShadow")- .HasColumnType("boolean");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("CreatedBy")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("Enabled")- .HasColumnType("boolean");-- b.Property<string>("IpRange")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("Reason")- .HasMaxLength(500)- .HasColumnType("character varying(500)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex(new[] { "Enabled" }, "IX_BlockedIpRange_Enabled");-- b.HasIndex(new[] { "IpRange" }, "IX_BlockedIpRange_IpRange")- .IsUnique();-- b.ToTable("BlockedIpRanges");- });-- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("CapabilityKey")- .IsRequired()- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("ClientName")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("CreatedBy")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime?>("EffectiveFrom")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime?>("EffectiveUntil")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("Enabled")- .HasColumnType("boolean");-- b.Property<Guid?>("GroupId")- .HasColumnType("uuid");-- b.Property<string>("Kind")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<string>("Notes")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<string>("Tier")- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Value")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("GroupId");-- b.HasIndex("Tier");-- b.HasIndex("UserId");-- b.HasIndex("CapabilityKey", "Enabled");-- b.ToTable("CapabilityRules");- });-- modelBuilder.Entity("AliasServerDb.ClientAction", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Payload")- .HasColumnType("jsonb");-- b.Property<Guid?>("TargetGroupId")- .HasColumnType("uuid");-- b.Property<string>("TargetUserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("TargetGroupId");-- b.HasIndex("TargetUserId");-- b.ToTable("ClientActions");- });-- modelBuilder.Entity("AliasServerDb.Email", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<int>("AttachmentCount")- .HasColumnType("integer");-- b.Property<DateTime>("Date")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime>("DateSystem")- .HasColumnType("timestamp with time zone");-- b.Property<string>("From")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("FromDomain")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("FromLocal")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("MessageHtml")- .HasColumnType("text");-- b.Property<string>("MessagePlain")- .HasColumnType("text");-- b.Property<string>("MessagePreview")- .HasColumnType("text");-- b.Property<string>("MessageSource")- .HasColumnType("text");-- b.Property<byte[]>("MessageSourceBytes")- .HasColumnType("bytea");-- b.Property<bool>("PushNotificationSent")- .HasColumnType("boolean");-- b.Property<string>("Subject")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("To")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("ToDomain")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("ToLocal")- .IsRequired()- .HasColumnType("text");-- b.Property<bool>("Visible")- .HasColumnType("boolean");-- b.HasKey("Id");-- b.HasIndex("Date");-- b.HasIndex("DateSystem");-- b.HasIndex("PushNotificationSent");-- b.HasIndex("Visible");-- b.HasIndex("To", "DateSystem");-- b.ToTable("Emails");- });-- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<byte[]>("Bytes")- .IsRequired()- .HasColumnType("bytea");-- b.Property<DateTime>("Date")- .HasColumnType("timestamp with time zone");-- b.Property<int>("EmailId")- .HasColumnType("integer");-- b.Property<string>("Filename")- .IsRequired()- .HasColumnType("text");-- b.Property<int>("Filesize")- .HasColumnType("integer");-- b.Property<string>("MimeType")- .IsRequired()- .HasColumnType("text");-- b.HasKey("Id");-- b.HasIndex("EmailId");-- b.ToTable("EmailAttachments");- });-- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Address")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("AddressDomain")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("AddressLocal")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("AnonymizedSenderCounted")- .HasColumnType("boolean");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("Address")- .IsUnique();-- b.ToTable("EmailClaims");- });-- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>- {- b.Property<Guid>("EmailClaimId")- .HasColumnType("uuid");-- b.Property<Guid>("VaultManifestId")- .HasColumnType("uuid");-- b.Property<string>("State")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.HasKey("EmailClaimId", "VaultManifestId");-- b.HasIndex("EmailClaimId")- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")- .HasFilter("\"State\" <> 'Removed'");-- b.HasIndex("VaultManifestId", "EmailClaimId");-- b.ToTable("EmailClaimLinks");- });-- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>- {- b.Property<int>("EmailId")- .HasColumnType("integer");-- b.Property<Guid>("VaultManifestDeliveryKeyId")- .HasColumnType("uuid");-- b.Property<string>("EncryptedSymmetricKey")- .IsRequired()- .HasColumnType("text");-- b.HasKey("EmailId", "VaultManifestDeliveryKeyId");-- b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");-- b.ToTable("EmailDecryptionKeys");- });-- modelBuilder.Entity("AliasServerDb.EmailPart", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<byte[]>("Bytes")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("EmailId")- .HasColumnType("integer");-- b.Property<int>("PartIndex")- .HasColumnType("integer");-- b.HasKey("Id");-- b.HasIndex("EmailId", "PartIndex")- .IsUnique();-- b.ToTable("EmailParts");- });-- modelBuilder.Entity("AliasServerDb.Group", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.PrimitiveCollection<int[]>("AnonymizedEmailAliasSenderCounts")- .IsRequired()- .ValueGeneratedOnAdd()- .HasColumnType("integer[]")- .HasDefaultValueSql("array_fill(0, ARRAY[64])");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("EmailsReceived")- .HasColumnType("integer");-- b.Property<int>("MaxEmailAgeDays")- .HasColumnType("integer");-- b.Property<int>("MaxEmails")- .HasColumnType("integer");-- b.Property<string>("Name")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("ShadowBlocked")- .HasColumnType("boolean");-- b.Property<DateTime?>("ShadowBlockedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("Type")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.ToTable("Groups");- });-- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedName")- .HasColumnType("text");-- b.Property<string>("EncryptedVek")- .HasColumnType("text");-- b.Property<Guid>("GroupId")- .HasColumnType("uuid");-- b.Property<string>("InviteeUserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("InviterUserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime?>("RespondedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("Role")- .HasColumnType("integer");-- b.Property<string>("State")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("UserGrantKeyId")- .HasColumnType("uuid");-- b.Property<int>("VaultKeyVersion")- .HasColumnType("integer");-- b.Property<Guid?>("VaultManifestId")- .HasColumnType("uuid");-- b.HasKey("Id");-- b.HasIndex("GroupId");-- b.HasIndex("InviterUserId");-- b.HasIndex("UserGrantKeyId");-- b.HasIndex("InviteeUserId", "State");-- b.HasIndex("VaultManifestId", "InviteeUserId")- .IsUnique()- .HasDatabaseName("UX_GroupInvitations_Manifest_Invitee_Pending")- .HasFilter("\"State\" = 'Pending'");-- b.ToTable("GroupInvitations");- });-- modelBuilder.Entity("AliasServerDb.GroupMember", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid>("GroupId")- .HasColumnType("uuid");-- b.Property<int>("Role")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId");-- b.HasIndex("GroupId", "UserId")- .IsUnique();-- b.ToTable("GroupMembers");- });-- modelBuilder.Entity("AliasServerDb.Log", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("Application")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("Exception")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Level")- .IsRequired()- .HasMaxLength(128)- .HasColumnType("character varying(128)");-- b.Property<string>("LogEvent")- .IsRequired()- .HasColumnType("text")- .HasColumnName("LogEvent");-- b.Property<string>("Message")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("MessageTemplate")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Properties")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("SourceContext")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("TimeStamp")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("Application");-- b.HasIndex("TimeStamp");-- b.ToTable("Logs", (string)null);- });-- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>- {- b.Property<string>("Id")- .HasColumnType("text");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime?>("ClearedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ClientIpAddress")- .HasColumnType("text");-- b.Property<string>("ClientPublicKey")- .IsRequired()- .HasColumnType("text");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedDecryptionKey")- .HasColumnType("text");-- b.Property<DateTime?>("FulfilledAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("MobileIpAddress")- .HasColumnType("text");-- b.Property<DateTime?>("RetrievedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .HasColumnType("text");-- b.HasKey("Id");-- b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");-- b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");-- b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");-- b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");-- b.HasIndex(new[] { "UserId" }, "IX_UserId");-- b.ToTable("MobileLoginRequests");- });-- modelBuilder.Entity("AliasServerDb.RateLimit", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int?>("AppliesToAccountAgeMaxDays")- .HasColumnType("integer");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("CreatedBy")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime?>("EffectiveFrom")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime?>("EffectiveUntil")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("Enabled")- .HasColumnType("boolean");-- b.Property<Guid?>("GroupId")- .HasColumnType("uuid");-- b.Property<int>("LimitType")- .HasColumnType("integer");-- b.Property<int>("MaxCount")- .HasColumnType("integer");-- b.Property<string>("Notes")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<int?>("Tier")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("WindowSeconds")- .HasColumnType("integer");-- b.HasKey("Id");-- b.HasIndex("GroupId");-- b.HasIndex("Tier");-- b.HasIndex("LimitType", "Enabled");-- b.ToTable("RateLimits");- });-- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>- {- b.Property<string>("Key")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Value")- .HasColumnType("text");-- b.HasKey("Key");-- b.ToTable("ServerSettings");- });-- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<TimeOnly?>("EndTime")- .HasColumnType("time without time zone");-- b.Property<string>("ErrorMessage")- .HasColumnType("text");-- b.Property<bool>("IsOnDemand")- .HasColumnType("boolean");-- b.Property<string>("Name")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("RunDate")- .HasColumnType("timestamp with time zone");-- b.Property<TimeOnly>("StartTime")- .HasColumnType("time without time zone");-- b.Property<int>("Status")- .HasColumnType("integer");-- b.HasKey("Id");-- b.ToTable("TaskRunnerJobs");- });-- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedPrivateKey")- .IsRequired()- .HasMaxLength(4000)- .HasColumnType("character varying(4000)");-- b.Property<bool>("IsPrimary")- .HasColumnType("boolean");-- b.Property<string>("PublicKey")- .IsRequired()- .HasMaxLength(4000)- .HasColumnType("character varying(4000)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId")- .IsUnique()- .HasDatabaseName("UX_UserGrantKeys_User_Primary")- .HasFilter("\"IsPrimary\"");-- b.ToTable("UserGrantKeys");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedAccountKey")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Label")- .IsRequired()- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<DateTime?>("LastUsedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Metadata")- .HasColumnType("jsonb");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId", "Type", "Label")- .IsUnique()- .HasDatabaseName("UX_UserUnlockKeys_UserId_Type_Label");-- b.ToTable("UserUnlockKeys");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>- {- b.Property<string>("Hash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<string>("OwnerUserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Category")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<byte[]>("EncryptedData")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<DateTime>("LastReferencedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("SizeBytes")- .HasColumnType("integer");-- b.HasKey("Hash", "OwnerUserId");-- b.HasIndex("OwnerUserId", "Category");-- b.ToTable("VaultBlobObjects");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("BlobHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");-- b.ToTable("VaultBlobReferences");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Category")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("CiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<byte[]>("EncryptedData")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("ManifestId", "Category");-- b.ToTable("VaultDataBuckets");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Category")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("CiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<byte[]>("EncryptedData")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("ManifestId", "Category", "RevisionNumber");-- b.ToTable("VaultDataBucketsHistory");- });-- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>- {- b.Property<Guid>("ManifestId")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Client")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("CredentialsCount")- .HasColumnType("integer");-- b.Property<int>("EmailClaimsCount")- .HasColumnType("integer");-- b.Property<string>("EncryptionSettings")- .HasColumnType("text");-- b.Property<string>("EncryptionType")- .HasColumnType("text");-- b.Property<int>("FileSize")- .HasColumnType("integer");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<byte[]>("ManifestBlob")- .HasColumnType("bytea");-- b.Property<string>("ManifestCiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<Guid>("OwnerGroupId")- .HasColumnType("uuid");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("Salt")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("StorageFormat")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("VaultBlob")- .HasColumnType("text");-- b.Property<string>("Verifier")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<string>("Version")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("ManifestId");-- b.HasIndex("OwnerGroupId");-- b.ToTable("VaultManifests");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int?>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedVek")- .IsRequired()- .HasColumnType("text");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<DateTime?>("LastUsedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Metadata")- .HasColumnType("jsonb");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("UserGrantKeyId")- .HasColumnType("uuid");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<Guid>("VaultManifestId")- .HasColumnType("uuid");-- b.HasKey("Id");-- b.HasIndex("UserGrantKeyId");-- b.HasIndex("VaultManifestId")- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");-- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")- .IsUnique()- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");-- b.ToTable("VaultManifestAccessKeys");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("IsPrimary")- .HasColumnType("boolean");-- b.Property<string>("PublicKey")- .IsRequired()- .HasMaxLength(4000)- .HasColumnType("character varying(4000)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid>("VaultManifestId")- .HasColumnType("uuid");-- b.HasKey("Id");-- b.HasIndex("VaultManifestId")- .IsUnique()- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")- .HasFilter("\"IsPrimary\"");-- b.HasIndex("VaultManifestId", "IsPrimary");-- b.ToTable("VaultManifestDeliveryKeys");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("Client")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("CredentialsCount")- .HasColumnType("integer");-- b.Property<int>("EmailClaimsCount")- .HasColumnType("integer");-- b.Property<string>("EncryptionSettings")- .HasColumnType("text");-- b.Property<string>("EncryptionType")- .HasColumnType("text");-- b.Property<int>("FileSize")- .HasColumnType("integer");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<byte[]>("ManifestBlob")- .HasColumnType("bytea");-- b.Property<string>("ManifestCiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<string>("Salt")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("StorageFormat")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("VaultBlob")- .HasColumnType("text");-- b.Property<string>("Verifier")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<string>("Version")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("ManifestId", "RevisionNumber");-- b.ToTable("VaultManifestsHistory", (string)null);- });-- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("CurrentStatus")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("DesiredStatus")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("Heartbeat")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ServiceName")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.ToTable("WorkerServiceStatuses");- });-- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("FriendlyName")- .HasColumnType("text");-- b.Property<string>("Xml")- .HasColumnType("text");-- b.HasKey("Id");-- b.ToTable("DataProtectionKeys");- });-- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("ClaimType")- .HasColumnType("text");-- b.Property<string>("ClaimValue")- .HasColumnType("text");-- b.Property<string>("UserId")- .HasColumnType("text");-- b.HasKey("Id");-- b.ToTable("UserClaims", (string)null);- });-- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>- {- b.Property<string>("UserId")- .HasColumnType("text");-- b.Property<string>("LoginProvider")- .HasColumnType("text");-- b.Property<string>("Name")- .HasColumnType("text");-- b.Property<string>("Value")- .HasColumnType("text");-- b.HasKey("UserId", "LoginProvider", "Name");-- b.ToTable("UserTokens", (string)null);- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>- {- b.HasOne("AliasServerDb.Group", "PersonalGroup")- .WithOne()- .HasForeignKey("AliasServerDb.AliasVaultUser", "PersonalGroupId")- .OnDelete(DeleteBehavior.Restrict)- .IsRequired();-- b.Navigation("PersonalGroup");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany()- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("Group");-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.ClientAction", b =>- {- b.HasOne("AliasServerDb.Group", "TargetGroup")- .WithMany()- .HasForeignKey("TargetGroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.HasOne("AliasServerDb.AliasVaultUser", "TargetUser")- .WithMany()- .HasForeignKey("TargetUserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("TargetGroup");-- b.Navigation("TargetUser");- });-- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>- {- b.HasOne("AliasServerDb.Email", "Email")- .WithMany("Attachments")- .HasForeignKey("EmailId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Email");- });-- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>- {- b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")- .WithMany("Links")- .HasForeignKey("EmailClaimId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")- .WithMany()- .HasForeignKey("VaultManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("EmailClaim");-- b.Navigation("VaultManifest");- });-- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>- {- b.HasOne("AliasServerDb.Email", "Email")- .WithMany("DecryptionKeys")- .HasForeignKey("EmailId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")- .WithMany("DecryptionKeys")- .HasForeignKey("VaultManifestDeliveryKeyId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired()- .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId");-- b.Navigation("Email");-- b.Navigation("VaultManifestDeliveryKey");- });-- modelBuilder.Entity("AliasServerDb.EmailPart", b =>- {- b.HasOne("AliasServerDb.Email", "Email")- .WithMany("Parts")- .HasForeignKey("EmailId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Email");- });-- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany()- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.AliasVaultUser", "Invitee")- .WithMany()- .HasForeignKey("InviteeUserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.AliasVaultUser", "Inviter")- .WithMany()- .HasForeignKey("InviterUserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")- .WithMany()- .HasForeignKey("UserGrantKeyId")- .OnDelete(DeleteBehavior.SetNull);-- b.Navigation("Group");-- b.Navigation("Invitee");-- b.Navigation("Inviter");-- b.Navigation("UserGrantKey");- });-- modelBuilder.Entity("AliasServerDb.GroupMember", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany("Members")- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Group");-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.RateLimit", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany()- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("Group");- });-- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("OwnerUserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>- {- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")- .WithMany()- .HasForeignKey("ManifestId", "Category")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Bucket");- });-- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>- {- b.HasOne("AliasServerDb.Group", "OwnerGroup")- .WithMany()- .HasForeignKey("OwnerGroupId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("OwnerGroup");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>- {- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")- .WithMany()- .HasForeignKey("UserGrantKeyId")- .OnDelete(DeleteBehavior.SetNull);-- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany("VaultManifestAccessKeys")- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");-- b.Navigation("UserGrantKey");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")- .WithMany()- .HasForeignKey("VaultManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("VaultManifest");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>- {- b.Navigation("VaultManifestAccessKeys");- });-- modelBuilder.Entity("AliasServerDb.Email", b =>- {- b.Navigation("Attachments");-- b.Navigation("DecryptionKeys");-- b.Navigation("Parts");- });-- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>- {- b.Navigation("Links");- });-- modelBuilder.Entity("AliasServerDb.Group", b =>- {- b.Navigation("Members");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>- {- b.Navigation("DecryptionKeys");- });-#pragma warning restore 612, 618- }- }-}diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260826154135_AddAlgorithmToPublicKeyTables.cs b/apps/server/Databases/AliasServerDb/Migrations/20260826154135_AddAlgorithmToPublicKeyTables.csdeleted file mode 100644index 132c18352..000000000--- a/apps/server/Databases/AliasServerDb/Migrations/20260826154135_AddAlgorithmToPublicKeyTables.cs+++ /dev/null@@ -1,90 +0,0 @@-using Microsoft.EntityFrameworkCore.Migrations;--#nullable disable--namespace AliasServerDb.Migrations-{- /// <inheritdoc />- public partial class AddAlgorithmToPublicKeyTables : Migration- {- /// <inheritdoc />- protected override void Up(MigrationBuilder migrationBuilder)- {- migrationBuilder.AddColumn<string>(- name: "Algorithm",- table: "VaultManifestDeliveryKeys",- type: "character varying(30)",- maxLength: 30,- nullable: true);-- migrationBuilder.AddColumn<string>(- name: "Algorithm",- table: "UserGrantKeys",- type: "character varying(30)",- maxLength: 30,- nullable: true);-- migrationBuilder.AddColumn<string>(- name: "Algorithm",- table: "MobileLoginRequests",- type: "character varying(30)",- maxLength: 30,- nullable: true);-- migrationBuilder.Sql("""- UPDATE "VaultManifestDeliveryKeys" SET "Algorithm" = 'rsa-oaep-sha256';- UPDATE "UserGrantKeys" SET "Algorithm" = 'rsa-oaep-sha256';- UPDATE "MobileLoginRequests" SET "Algorithm" = 'rsa-oaep-sha256';- """);-- migrationBuilder.AlterColumn<string>(- name: "Algorithm",- table: "VaultManifestDeliveryKeys",- type: "character varying(30)",- maxLength: 30,- nullable: false,- oldClrType: typeof(string),- oldType: "character varying(30)",- oldMaxLength: 30,- oldNullable: true);-- migrationBuilder.AlterColumn<string>(- name: "Algorithm",- table: "UserGrantKeys",- type: "character varying(30)",- maxLength: 30,- nullable: false,- oldClrType: typeof(string),- oldType: "character varying(30)",- oldMaxLength: 30,- oldNullable: true);-- migrationBuilder.AlterColumn<string>(- name: "Algorithm",- table: "MobileLoginRequests",- type: "character varying(30)",- maxLength: 30,- nullable: false,- oldClrType: typeof(string),- oldType: "character varying(30)",- oldMaxLength: 30,- oldNullable: true);- }-- /// <inheritdoc />- protected override void Down(MigrationBuilder migrationBuilder)- {- migrationBuilder.DropColumn(- name: "Algorithm",- table: "VaultManifestDeliveryKeys");-- migrationBuilder.DropColumn(- name: "Algorithm",- table: "UserGrantKeys");-- migrationBuilder.DropColumn(- name: "Algorithm",- table: "MobileLoginRequests");- }- }-}diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260908094037_AddUserUnlockKeysHistory.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260908094037_AddUserUnlockKeysHistory.Designer.csdeleted file mode 100644index 93aedeb74..000000000--- a/apps/server/Databases/AliasServerDb/Migrations/20260908094037_AddUserUnlockKeysHistory.Designer.cs+++ /dev/null@@ -1,2019 +0,0 @@-// <auto-generated />-using System;-using AliasServerDb;-using Microsoft.EntityFrameworkCore;-using Microsoft.EntityFrameworkCore.Infrastructure;-using Microsoft.EntityFrameworkCore.Migrations;-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;--#nullable disable--namespace AliasServerDb.Migrations-{- [DbContext(typeof(AliasServerDbContext))]- [Migration("20260908094037_AddUserUnlockKeysHistory")]- partial class AddUserUnlockKeysHistory- {- /// <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)- .HasAnnotation("Relational:MaxIdentifierLength", 63);-- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);-- modelBuilder.Entity("AliasServerDb.AdminUser", b =>- {- b.Property<string>("Id")- .HasColumnType("text");-- b.Property<int>("AccessFailedCount")- .HasColumnType("integer");-- b.Property<string>("ConcurrencyStamp")- .HasColumnType("text");-- b.Property<string>("Email")- .HasColumnType("text");-- b.Property<bool>("EmailConfirmed")- .HasColumnType("boolean");-- b.Property<DateTime?>("LastPasswordChanged")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("LockoutEnabled")- .HasColumnType("boolean");-- b.Property<DateTimeOffset?>("LockoutEnd")- .HasColumnType("timestamp with time zone");-- b.Property<string>("NormalizedEmail")- .HasColumnType("text");-- b.Property<string>("NormalizedUserName")- .HasColumnType("text");-- b.Property<string>("PasswordHash")- .HasColumnType("text");-- b.Property<string>("PhoneNumber")- .HasColumnType("text");-- b.Property<bool>("PhoneNumberConfirmed")- .HasColumnType("boolean");-- b.Property<string>("SecurityStamp")- .HasColumnType("text");-- b.Property<bool>("TwoFactorEnabled")- .HasColumnType("boolean");-- b.Property<string>("UserName")- .HasColumnType("text");-- b.HasKey("Id");-- b.ToTable("AdminUsers");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>- {- b.Property<string>("Id")- .HasColumnType("text");-- b.Property<int>("AccessFailedCount")- .HasColumnType("integer");-- b.Property<bool>("Blocked")- .HasColumnType("boolean");-- b.Property<DateTime?>("BlockedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ConcurrencyStamp")- .HasColumnType("text");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Email")- .HasColumnType("text");-- b.Property<bool>("EmailConfirmed")- .HasColumnType("boolean");-- b.Property<DateTime?>("LastActivityDate")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("LockoutEnabled")- .HasColumnType("boolean");-- b.Property<DateTimeOffset?>("LockoutEnd")- .HasColumnType("timestamp with time zone");-- b.Property<string>("NormalizedEmail")- .HasColumnType("text");-- b.Property<string>("NormalizedUserName")- .HasColumnType("text");-- b.Property<DateTime>("PasswordChangedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("PasswordHash")- .HasColumnType("text");-- b.Property<Guid>("PersonalGroupId")- .HasColumnType("uuid");-- b.Property<string>("PhoneNumber")- .HasColumnType("text");-- b.Property<bool>("PhoneNumberConfirmed")- .HasColumnType("boolean");-- b.Property<string>("SecurityStamp")- .HasColumnType("text");-- b.Property<string>("SrpIdentity")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("TwoFactorEnabled")- .HasColumnType("boolean");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserName")- .HasColumnType("text");-- b.HasKey("Id");-- b.HasIndex("PersonalGroupId")- .IsUnique()- .HasDatabaseName("UX_AliasVaultUsers_PersonalGroupId");-- b.ToTable("AliasVaultUsers");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("DeviceIdentifier")- .IsRequired()- .HasColumnType("text");-- b.Property<DateTime>("ExpireDate")- .HasMaxLength(255)- .HasColumnType("timestamp with time zone");-- b.Property<string>("IpAddress")- .HasMaxLength(45)- .HasColumnType("character varying(45)");-- b.Property<string>("PreviousTokenValue")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Value")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId");-- b.ToTable("AliasVaultUserRefreshTokens");- });-- modelBuilder.Entity("AliasServerDb.AuthLog", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("AdditionalInfo")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Browser")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("Client")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("Country")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("DeviceType")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<int>("EventType")- .HasColumnType("integer");-- b.Property<int?>("FailureReason")- .HasColumnType("integer");-- b.Property<string>("IpAddress")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<bool>("IsSuccess")- .HasColumnType("boolean");-- b.Property<bool>("IsSuspiciousActivity")- .HasColumnType("boolean");-- b.Property<string>("OperatingSystem")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("RequestPath")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("Timestamp")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Username")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex(new[] { "EventType" }, "IX_EventType");-- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");-- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");-- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")- .IsDescending(false, false, true);-- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")- .IsDescending(false, true);-- b.ToTable("AuthLogs");- });-- modelBuilder.Entity("AliasServerDb.BlockedIpRange", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<bool>("BlockLogin")- .HasColumnType("boolean");-- b.Property<bool>("BlockRegistration")- .HasColumnType("boolean");-- b.Property<bool>("BlockShadow")- .HasColumnType("boolean");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("CreatedBy")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("Enabled")- .HasColumnType("boolean");-- b.Property<string>("IpRange")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("Reason")- .HasMaxLength(500)- .HasColumnType("character varying(500)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex(new[] { "Enabled" }, "IX_BlockedIpRange_Enabled");-- b.HasIndex(new[] { "IpRange" }, "IX_BlockedIpRange_IpRange")- .IsUnique();-- b.ToTable("BlockedIpRanges");- });-- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("CapabilityKey")- .IsRequired()- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("ClientName")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("CreatedBy")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime?>("EffectiveFrom")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime?>("EffectiveUntil")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("Enabled")- .HasColumnType("boolean");-- b.Property<Guid?>("GroupId")- .HasColumnType("uuid");-- b.Property<string>("Kind")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<string>("Notes")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<string>("Tier")- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Value")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("GroupId");-- b.HasIndex("Tier");-- b.HasIndex("UserId");-- b.HasIndex("CapabilityKey", "Enabled");-- b.ToTable("CapabilityRules");- });-- modelBuilder.Entity("AliasServerDb.ClientAction", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Payload")- .HasColumnType("jsonb");-- b.Property<Guid?>("TargetGroupId")- .HasColumnType("uuid");-- b.Property<string>("TargetUserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("TargetGroupId");-- b.HasIndex("TargetUserId");-- b.ToTable("ClientActions");- });-- modelBuilder.Entity("AliasServerDb.Email", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<int>("AttachmentCount")- .HasColumnType("integer");-- b.Property<DateTime>("Date")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime>("DateSystem")- .HasColumnType("timestamp with time zone");-- b.Property<string>("From")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("FromDomain")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("FromLocal")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("MessageHtml")- .HasColumnType("text");-- b.Property<string>("MessagePlain")- .HasColumnType("text");-- b.Property<string>("MessagePreview")- .HasColumnType("text");-- b.Property<string>("MessageSource")- .HasColumnType("text");-- b.Property<byte[]>("MessageSourceBytes")- .HasColumnType("bytea");-- b.Property<bool>("PushNotificationSent")- .HasColumnType("boolean");-- b.Property<string>("Subject")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("To")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("ToDomain")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("ToLocal")- .IsRequired()- .HasColumnType("text");-- b.Property<bool>("Visible")- .HasColumnType("boolean");-- b.HasKey("Id");-- b.HasIndex("Date");-- b.HasIndex("DateSystem");-- b.HasIndex("PushNotificationSent");-- b.HasIndex("Visible");-- b.HasIndex("To", "DateSystem");-- b.ToTable("Emails");- });-- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<byte[]>("Bytes")- .IsRequired()- .HasColumnType("bytea");-- b.Property<DateTime>("Date")- .HasColumnType("timestamp with time zone");-- b.Property<int>("EmailId")- .HasColumnType("integer");-- b.Property<string>("Filename")- .IsRequired()- .HasColumnType("text");-- b.Property<int>("Filesize")- .HasColumnType("integer");-- b.Property<string>("MimeType")- .IsRequired()- .HasColumnType("text");-- b.HasKey("Id");-- b.HasIndex("EmailId");-- b.ToTable("EmailAttachments");- });-- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Address")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("AddressDomain")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("AddressLocal")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("AnonymizedSenderCounted")- .HasColumnType("boolean");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("Address")- .IsUnique();-- b.ToTable("EmailClaims");- });-- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>- {- b.Property<Guid>("EmailClaimId")- .HasColumnType("uuid");-- b.Property<Guid>("VaultManifestId")- .HasColumnType("uuid");-- b.Property<string>("State")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.HasKey("EmailClaimId", "VaultManifestId");-- b.HasIndex("EmailClaimId")- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")- .HasFilter("\"State\" <> 'Removed'");-- b.HasIndex("VaultManifestId", "EmailClaimId");-- b.ToTable("EmailClaimLinks");- });-- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>- {- b.Property<int>("EmailId")- .HasColumnType("integer");-- b.Property<Guid>("VaultManifestDeliveryKeyId")- .HasColumnType("uuid");-- b.Property<string>("EncryptedSymmetricKey")- .IsRequired()- .HasColumnType("text");-- b.HasKey("EmailId", "VaultManifestDeliveryKeyId");-- b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");-- b.ToTable("EmailDecryptionKeys");- });-- modelBuilder.Entity("AliasServerDb.EmailPart", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<byte[]>("Bytes")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("EmailId")- .HasColumnType("integer");-- b.Property<int>("PartIndex")- .HasColumnType("integer");-- b.HasKey("Id");-- b.HasIndex("EmailId", "PartIndex")- .IsUnique();-- b.ToTable("EmailParts");- });-- modelBuilder.Entity("AliasServerDb.Group", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.PrimitiveCollection<int[]>("AnonymizedEmailAliasSenderCounts")- .IsRequired()- .ValueGeneratedOnAdd()- .HasColumnType("integer[]")- .HasDefaultValueSql("array_fill(0, ARRAY[64])");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("EmailsReceived")- .HasColumnType("integer");-- b.Property<int>("MaxEmailAgeDays")- .HasColumnType("integer");-- b.Property<int>("MaxEmails")- .HasColumnType("integer");-- b.Property<string>("Name")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("ShadowBlocked")- .HasColumnType("boolean");-- b.Property<DateTime?>("ShadowBlockedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("Type")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.ToTable("Groups");- });-- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedName")- .HasColumnType("text");-- b.Property<string>("EncryptedVek")- .HasColumnType("text");-- b.Property<Guid>("GroupId")- .HasColumnType("uuid");-- b.Property<string>("InviteeUserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("InviterUserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime?>("RespondedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("Role")- .HasColumnType("integer");-- b.Property<string>("State")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("UserGrantKeyId")- .HasColumnType("uuid");-- b.Property<int>("VaultKeyVersion")- .HasColumnType("integer");-- b.Property<Guid?>("VaultManifestId")- .HasColumnType("uuid");-- b.HasKey("Id");-- b.HasIndex("GroupId");-- b.HasIndex("InviterUserId");-- b.HasIndex("UserGrantKeyId");-- b.HasIndex("InviteeUserId", "State");-- b.HasIndex("VaultManifestId", "InviteeUserId")- .IsUnique()- .HasDatabaseName("UX_GroupInvitations_Manifest_Invitee_Pending")- .HasFilter("\"State\" = 'Pending'");-- b.ToTable("GroupInvitations");- });-- modelBuilder.Entity("AliasServerDb.GroupMember", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid>("GroupId")- .HasColumnType("uuid");-- b.Property<int>("Role")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId");-- b.HasIndex("GroupId", "UserId")- .IsUnique();-- b.ToTable("GroupMembers");- });-- modelBuilder.Entity("AliasServerDb.Log", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("Application")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("Exception")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Level")- .IsRequired()- .HasMaxLength(128)- .HasColumnType("character varying(128)");-- b.Property<string>("LogEvent")- .IsRequired()- .HasColumnType("text")- .HasColumnName("LogEvent");-- b.Property<string>("Message")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("MessageTemplate")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Properties")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("SourceContext")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("TimeStamp")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("Application");-- b.HasIndex("TimeStamp");-- b.ToTable("Logs", (string)null);- });-- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>- {- b.Property<string>("Id")- .HasColumnType("text");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime?>("ClearedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ClientIpAddress")- .HasColumnType("text");-- b.Property<string>("ClientPublicKey")- .IsRequired()- .HasColumnType("text");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedDecryptionKey")- .HasColumnType("text");-- b.Property<DateTime?>("FulfilledAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("MobileIpAddress")- .HasColumnType("text");-- b.Property<DateTime?>("RetrievedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .HasColumnType("text");-- b.HasKey("Id");-- b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");-- b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");-- b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");-- b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");-- b.HasIndex(new[] { "UserId" }, "IX_UserId");-- b.ToTable("MobileLoginRequests");- });-- modelBuilder.Entity("AliasServerDb.RateLimit", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int?>("AppliesToAccountAgeMaxDays")- .HasColumnType("integer");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("CreatedBy")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime?>("EffectiveFrom")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime?>("EffectiveUntil")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("Enabled")- .HasColumnType("boolean");-- b.Property<Guid?>("GroupId")- .HasColumnType("uuid");-- b.Property<int>("LimitType")- .HasColumnType("integer");-- b.Property<int>("MaxCount")- .HasColumnType("integer");-- b.Property<string>("Notes")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<int?>("Tier")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("WindowSeconds")- .HasColumnType("integer");-- b.HasKey("Id");-- b.HasIndex("GroupId");-- b.HasIndex("Tier");-- b.HasIndex("LimitType", "Enabled");-- b.ToTable("RateLimits");- });-- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>- {- b.Property<string>("Key")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Value")- .HasColumnType("text");-- b.HasKey("Key");-- b.ToTable("ServerSettings");- });-- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<TimeOnly?>("EndTime")- .HasColumnType("time without time zone");-- b.Property<string>("ErrorMessage")- .HasColumnType("text");-- b.Property<bool>("IsOnDemand")- .HasColumnType("boolean");-- b.Property<string>("Name")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("RunDate")- .HasColumnType("timestamp with time zone");-- b.Property<TimeOnly>("StartTime")- .HasColumnType("time without time zone");-- b.Property<int>("Status")- .HasColumnType("integer");-- b.HasKey("Id");-- b.ToTable("TaskRunnerJobs");- });-- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedPrivateKey")- .IsRequired()- .HasMaxLength(4000)- .HasColumnType("character varying(4000)");-- b.Property<bool>("IsPrimary")- .HasColumnType("boolean");-- b.Property<string>("PublicKey")- .IsRequired()- .HasMaxLength(2000)- .HasColumnType("character varying(2000)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId")- .IsUnique()- .HasDatabaseName("UX_UserGrantKeys_User_Primary")- .HasFilter("\"IsPrimary\"");-- b.ToTable("UserGrantKeys");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedAccountKey")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Label")- .IsRequired()- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<DateTime?>("LastUsedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Metadata")- .HasColumnType("jsonb");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId", "Type", "Label")- .IsUnique()- .HasDatabaseName("UX_UserUnlockKeys_UserId_Type_Label");-- b.ToTable("UserUnlockKeys");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("ArchivedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ArchivedByClient")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedAccountKey")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Label")- .IsRequired()- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("Metadata")- .HasColumnType("jsonb");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<Guid>("UnlockKeyId")- .HasColumnType("uuid");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("ArchivedAt")- .HasDatabaseName("IX_UserUnlockKeysHistory_ArchivedAt");-- b.HasIndex("UserId", "Type", "ArchivedAt")- .HasDatabaseName("IX_UserUnlockKeysHistory_UserId_Type_ArchivedAt");-- b.ToTable("UserUnlockKeysHistory", (string)null);- });-- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>- {- b.Property<string>("Hash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<string>("OwnerUserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Category")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<byte[]>("EncryptedData")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<DateTime>("LastReferencedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("SizeBytes")- .HasColumnType("integer");-- b.HasKey("Hash", "OwnerUserId");-- b.HasIndex("OwnerUserId", "Category");-- b.ToTable("VaultBlobObjects");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("BlobHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");-- b.ToTable("VaultBlobReferences");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Category")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("CiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<byte[]>("EncryptedData")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("ManifestId", "Category");-- b.ToTable("VaultDataBuckets");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Category")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("CiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<byte[]>("EncryptedData")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("ManifestId", "Category", "RevisionNumber");-- b.ToTable("VaultDataBucketsHistory");- });-- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>- {- b.Property<Guid>("ManifestId")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Client")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("CredentialsCount")- .HasColumnType("integer");-- b.Property<int>("EmailClaimsCount")- .HasColumnType("integer");-- b.Property<string>("EncryptionSettings")- .HasColumnType("text");-- b.Property<string>("EncryptionType")- .HasColumnType("text");-- b.Property<int>("FileSize")- .HasColumnType("integer");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<byte[]>("ManifestBlob")- .HasColumnType("bytea");-- b.Property<string>("ManifestCiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<Guid>("OwnerGroupId")- .HasColumnType("uuid");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("Salt")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("StorageFormat")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("VaultBlob")- .HasColumnType("text");-- b.Property<string>("Verifier")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<string>("Version")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("ManifestId");-- b.HasIndex("OwnerGroupId");-- b.ToTable("VaultManifests");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int?>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedVek")- .IsRequired()- .HasColumnType("text");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<DateTime?>("LastUsedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Metadata")- .HasColumnType("jsonb");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("UserGrantKeyId")- .HasColumnType("uuid");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<Guid>("VaultManifestId")- .HasColumnType("uuid");-- b.HasKey("Id");-- b.HasIndex("UserGrantKeyId");-- b.HasIndex("VaultManifestId")- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");-- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")- .IsUnique()- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");-- b.ToTable("VaultManifestAccessKeys");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("IsPrimary")- .HasColumnType("boolean");-- b.Property<string>("PublicKey")- .IsRequired()- .HasMaxLength(2000)- .HasColumnType("character varying(2000)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid>("VaultManifestId")- .HasColumnType("uuid");-- b.HasKey("Id");-- b.HasIndex("VaultManifestId")- .IsUnique()- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")- .HasFilter("\"IsPrimary\"");-- b.HasIndex("VaultManifestId", "IsPrimary");-- b.ToTable("VaultManifestDeliveryKeys");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("Client")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("CredentialsCount")- .HasColumnType("integer");-- b.Property<int>("EmailClaimsCount")- .HasColumnType("integer");-- b.Property<string>("EncryptionSettings")- .HasColumnType("text");-- b.Property<string>("EncryptionType")- .HasColumnType("text");-- b.Property<int>("FileSize")- .HasColumnType("integer");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<byte[]>("ManifestBlob")- .HasColumnType("bytea");-- b.Property<string>("ManifestCiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<string>("Salt")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("StorageFormat")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("VaultBlob")- .HasColumnType("text");-- b.Property<string>("Verifier")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<string>("Version")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("ManifestId", "RevisionNumber");-- b.ToTable("VaultManifestsHistory", (string)null);- });-- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("CurrentStatus")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("DesiredStatus")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("Heartbeat")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ServiceName")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.ToTable("WorkerServiceStatuses");- });-- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("FriendlyName")- .HasColumnType("text");-- b.Property<string>("Xml")- .HasColumnType("text");-- b.HasKey("Id");-- b.ToTable("DataProtectionKeys");- });-- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("ClaimType")- .HasColumnType("text");-- b.Property<string>("ClaimValue")- .HasColumnType("text");-- b.Property<string>("UserId")- .HasColumnType("text");-- b.HasKey("Id");-- b.ToTable("UserClaims", (string)null);- });-- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>- {- b.Property<string>("UserId")- .HasColumnType("text");-- b.Property<string>("LoginProvider")- .HasColumnType("text");-- b.Property<string>("Name")- .HasColumnType("text");-- b.Property<string>("Value")- .HasColumnType("text");-- b.HasKey("UserId", "LoginProvider", "Name");-- b.ToTable("UserTokens", (string)null);- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>- {- b.HasOne("AliasServerDb.Group", "PersonalGroup")- .WithOne()- .HasForeignKey("AliasServerDb.AliasVaultUser", "PersonalGroupId")- .OnDelete(DeleteBehavior.Restrict)- .IsRequired();-- b.Navigation("PersonalGroup");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany()- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("Group");-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.ClientAction", b =>- {- b.HasOne("AliasServerDb.Group", "TargetGroup")- .WithMany()- .HasForeignKey("TargetGroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.HasOne("AliasServerDb.AliasVaultUser", "TargetUser")- .WithMany()- .HasForeignKey("TargetUserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("TargetGroup");-- b.Navigation("TargetUser");- });-- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>- {- b.HasOne("AliasServerDb.Email", "Email")- .WithMany("Attachments")- .HasForeignKey("EmailId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Email");- });-- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>- {- b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")- .WithMany("Links")- .HasForeignKey("EmailClaimId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")- .WithMany()- .HasForeignKey("VaultManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("EmailClaim");-- b.Navigation("VaultManifest");- });-- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>- {- b.HasOne("AliasServerDb.Email", "Email")- .WithMany("DecryptionKeys")- .HasForeignKey("EmailId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")- .WithMany("DecryptionKeys")- .HasForeignKey("VaultManifestDeliveryKeyId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired()- .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId");-- b.Navigation("Email");-- b.Navigation("VaultManifestDeliveryKey");- });-- modelBuilder.Entity("AliasServerDb.EmailPart", b =>- {- b.HasOne("AliasServerDb.Email", "Email")- .WithMany("Parts")- .HasForeignKey("EmailId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Email");- });-- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany()- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.AliasVaultUser", "Invitee")- .WithMany()- .HasForeignKey("InviteeUserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.AliasVaultUser", "Inviter")- .WithMany()- .HasForeignKey("InviterUserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")- .WithMany()- .HasForeignKey("UserGrantKeyId")- .OnDelete(DeleteBehavior.SetNull);-- b.Navigation("Group");-- b.Navigation("Invitee");-- b.Navigation("Inviter");-- b.Navigation("UserGrantKey");- });-- modelBuilder.Entity("AliasServerDb.GroupMember", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany("Members")- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Group");-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.RateLimit", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany()- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("Group");- });-- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("OwnerUserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>- {- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")- .WithMany()- .HasForeignKey("ManifestId", "Category")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Bucket");- });-- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>- {- b.HasOne("AliasServerDb.Group", "OwnerGroup")- .WithMany()- .HasForeignKey("OwnerGroupId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("OwnerGroup");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>- {- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")- .WithMany()- .HasForeignKey("UserGrantKeyId")- .OnDelete(DeleteBehavior.SetNull);-- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany("VaultManifestAccessKeys")- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");-- b.Navigation("UserGrantKey");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")- .WithMany()- .HasForeignKey("VaultManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("VaultManifest");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>- {- b.Navigation("VaultManifestAccessKeys");- });-- modelBuilder.Entity("AliasServerDb.Email", b =>- {- b.Navigation("Attachments");-- b.Navigation("DecryptionKeys");-- b.Navigation("Parts");- });-- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>- {- b.Navigation("Links");- });-- modelBuilder.Entity("AliasServerDb.Group", b =>- {- b.Navigation("Members");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>- {- b.Navigation("DecryptionKeys");- });-#pragma warning restore 612, 618- }- }-}diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260908094037_AddUserUnlockKeysHistory.cs b/apps/server/Databases/AliasServerDb/Migrations/20260908094037_AddUserUnlockKeysHistory.csdeleted file mode 100644index 5aea17b5e..000000000--- a/apps/server/Databases/AliasServerDb/Migrations/20260908094037_AddUserUnlockKeysHistory.cs+++ /dev/null@@ -1,61 +0,0 @@-using System;-using Microsoft.EntityFrameworkCore.Migrations;--#nullable disable--namespace AliasServerDb.Migrations-{- /// <inheritdoc />- public partial class AddUserUnlockKeysHistory : Migration- {- /// <inheritdoc />- protected override void Up(MigrationBuilder migrationBuilder)- {- migrationBuilder.CreateTable(- name: "UserUnlockKeysHistory",- columns: table => new- {- Id = table.Column<Guid>(type: "uuid", nullable: false),- UnlockKeyId = table.Column<Guid>(type: "uuid", nullable: false),- UserId = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),- Type = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),- Algorithm = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),- Label = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),- EncryptedAccountKey = table.Column<string>(type: "text", nullable: false),- AccountKeyVersion = table.Column<int>(type: "integer", nullable: false),- Metadata = table.Column<string>(type: "jsonb", nullable: true),- CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),- UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),- ArchivedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),- ArchivedByClient = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true)- },- constraints: table =>- {- table.PrimaryKey("PK_UserUnlockKeysHistory", x => x.Id);- table.ForeignKey(- name: "FK_UserUnlockKeysHistory_AliasVaultUsers_UserId",- column: x => x.UserId,- principalTable: "AliasVaultUsers",- principalColumn: "Id",- onDelete: ReferentialAction.Cascade);- });-- migrationBuilder.CreateIndex(- name: "IX_UserUnlockKeysHistory_ArchivedAt",- table: "UserUnlockKeysHistory",- column: "ArchivedAt");-- migrationBuilder.CreateIndex(- name: "IX_UserUnlockKeysHistory_UserId_Type_ArchivedAt",- table: "UserUnlockKeysHistory",- columns: new[] { "UserId", "Type", "ArchivedAt" });- }-- /// <inheritdoc />- protected override void Down(MigrationBuilder migrationBuilder)- {- migrationBuilder.DropTable(- name: "UserUnlockKeysHistory");- }- }-}diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260908151046_DropVaultBlobLastReferencedAt.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260908151046_DropVaultBlobLastReferencedAt.Designer.csdeleted file mode 100644index 3d217b0c8..000000000--- a/apps/server/Databases/AliasServerDb/Migrations/20260908151046_DropVaultBlobLastReferencedAt.Designer.cs+++ /dev/null@@ -1,2016 +0,0 @@-// <auto-generated />-using System;-using AliasServerDb;-using Microsoft.EntityFrameworkCore;-using Microsoft.EntityFrameworkCore.Infrastructure;-using Microsoft.EntityFrameworkCore.Migrations;-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;--#nullable disable--namespace AliasServerDb.Migrations-{- [DbContext(typeof(AliasServerDbContext))]- [Migration("20260908151046_DropVaultBlobLastReferencedAt")]- partial class DropVaultBlobLastReferencedAt- {- /// <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)- .HasAnnotation("Relational:MaxIdentifierLength", 63);-- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);-- modelBuilder.Entity("AliasServerDb.AdminUser", b =>- {- b.Property<string>("Id")- .HasColumnType("text");-- b.Property<int>("AccessFailedCount")- .HasColumnType("integer");-- b.Property<string>("ConcurrencyStamp")- .HasColumnType("text");-- b.Property<string>("Email")- .HasColumnType("text");-- b.Property<bool>("EmailConfirmed")- .HasColumnType("boolean");-- b.Property<DateTime?>("LastPasswordChanged")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("LockoutEnabled")- .HasColumnType("boolean");-- b.Property<DateTimeOffset?>("LockoutEnd")- .HasColumnType("timestamp with time zone");-- b.Property<string>("NormalizedEmail")- .HasColumnType("text");-- b.Property<string>("NormalizedUserName")- .HasColumnType("text");-- b.Property<string>("PasswordHash")- .HasColumnType("text");-- b.Property<string>("PhoneNumber")- .HasColumnType("text");-- b.Property<bool>("PhoneNumberConfirmed")- .HasColumnType("boolean");-- b.Property<string>("SecurityStamp")- .HasColumnType("text");-- b.Property<bool>("TwoFactorEnabled")- .HasColumnType("boolean");-- b.Property<string>("UserName")- .HasColumnType("text");-- b.HasKey("Id");-- b.ToTable("AdminUsers");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>- {- b.Property<string>("Id")- .HasColumnType("text");-- b.Property<int>("AccessFailedCount")- .HasColumnType("integer");-- b.Property<bool>("Blocked")- .HasColumnType("boolean");-- b.Property<DateTime?>("BlockedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ConcurrencyStamp")- .HasColumnType("text");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Email")- .HasColumnType("text");-- b.Property<bool>("EmailConfirmed")- .HasColumnType("boolean");-- b.Property<DateTime?>("LastActivityDate")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("LockoutEnabled")- .HasColumnType("boolean");-- b.Property<DateTimeOffset?>("LockoutEnd")- .HasColumnType("timestamp with time zone");-- b.Property<string>("NormalizedEmail")- .HasColumnType("text");-- b.Property<string>("NormalizedUserName")- .HasColumnType("text");-- b.Property<DateTime>("PasswordChangedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("PasswordHash")- .HasColumnType("text");-- b.Property<Guid>("PersonalGroupId")- .HasColumnType("uuid");-- b.Property<string>("PhoneNumber")- .HasColumnType("text");-- b.Property<bool>("PhoneNumberConfirmed")- .HasColumnType("boolean");-- b.Property<string>("SecurityStamp")- .HasColumnType("text");-- b.Property<string>("SrpIdentity")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("TwoFactorEnabled")- .HasColumnType("boolean");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserName")- .HasColumnType("text");-- b.HasKey("Id");-- b.HasIndex("PersonalGroupId")- .IsUnique()- .HasDatabaseName("UX_AliasVaultUsers_PersonalGroupId");-- b.ToTable("AliasVaultUsers");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("DeviceIdentifier")- .IsRequired()- .HasColumnType("text");-- b.Property<DateTime>("ExpireDate")- .HasMaxLength(255)- .HasColumnType("timestamp with time zone");-- b.Property<string>("IpAddress")- .HasMaxLength(45)- .HasColumnType("character varying(45)");-- b.Property<string>("PreviousTokenValue")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Value")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId");-- b.ToTable("AliasVaultUserRefreshTokens");- });-- modelBuilder.Entity("AliasServerDb.AuthLog", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("AdditionalInfo")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Browser")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("Client")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("Country")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("DeviceType")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<int>("EventType")- .HasColumnType("integer");-- b.Property<int?>("FailureReason")- .HasColumnType("integer");-- b.Property<string>("IpAddress")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<bool>("IsSuccess")- .HasColumnType("boolean");-- b.Property<bool>("IsSuspiciousActivity")- .HasColumnType("boolean");-- b.Property<string>("OperatingSystem")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("RequestPath")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("Timestamp")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Username")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex(new[] { "EventType" }, "IX_EventType");-- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");-- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");-- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")- .IsDescending(false, false, true);-- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")- .IsDescending(false, true);-- b.ToTable("AuthLogs");- });-- modelBuilder.Entity("AliasServerDb.BlockedIpRange", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<bool>("BlockLogin")- .HasColumnType("boolean");-- b.Property<bool>("BlockRegistration")- .HasColumnType("boolean");-- b.Property<bool>("BlockShadow")- .HasColumnType("boolean");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("CreatedBy")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("Enabled")- .HasColumnType("boolean");-- b.Property<string>("IpRange")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("Reason")- .HasMaxLength(500)- .HasColumnType("character varying(500)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex(new[] { "Enabled" }, "IX_BlockedIpRange_Enabled");-- b.HasIndex(new[] { "IpRange" }, "IX_BlockedIpRange_IpRange")- .IsUnique();-- b.ToTable("BlockedIpRanges");- });-- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("CapabilityKey")- .IsRequired()- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("ClientName")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("CreatedBy")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime?>("EffectiveFrom")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime?>("EffectiveUntil")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("Enabled")- .HasColumnType("boolean");-- b.Property<Guid?>("GroupId")- .HasColumnType("uuid");-- b.Property<string>("Kind")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<string>("Notes")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<string>("Tier")- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Value")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("GroupId");-- b.HasIndex("Tier");-- b.HasIndex("UserId");-- b.HasIndex("CapabilityKey", "Enabled");-- b.ToTable("CapabilityRules");- });-- modelBuilder.Entity("AliasServerDb.ClientAction", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Payload")- .HasColumnType("jsonb");-- b.Property<Guid?>("TargetGroupId")- .HasColumnType("uuid");-- b.Property<string>("TargetUserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("TargetGroupId");-- b.HasIndex("TargetUserId");-- b.ToTable("ClientActions");- });-- modelBuilder.Entity("AliasServerDb.Email", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<int>("AttachmentCount")- .HasColumnType("integer");-- b.Property<DateTime>("Date")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime>("DateSystem")- .HasColumnType("timestamp with time zone");-- b.Property<string>("From")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("FromDomain")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("FromLocal")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("MessageHtml")- .HasColumnType("text");-- b.Property<string>("MessagePlain")- .HasColumnType("text");-- b.Property<string>("MessagePreview")- .HasColumnType("text");-- b.Property<string>("MessageSource")- .HasColumnType("text");-- b.Property<byte[]>("MessageSourceBytes")- .HasColumnType("bytea");-- b.Property<bool>("PushNotificationSent")- .HasColumnType("boolean");-- b.Property<string>("Subject")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("To")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("ToDomain")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("ToLocal")- .IsRequired()- .HasColumnType("text");-- b.Property<bool>("Visible")- .HasColumnType("boolean");-- b.HasKey("Id");-- b.HasIndex("Date");-- b.HasIndex("DateSystem");-- b.HasIndex("PushNotificationSent");-- b.HasIndex("Visible");-- b.HasIndex("To", "DateSystem");-- b.ToTable("Emails");- });-- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<byte[]>("Bytes")- .IsRequired()- .HasColumnType("bytea");-- b.Property<DateTime>("Date")- .HasColumnType("timestamp with time zone");-- b.Property<int>("EmailId")- .HasColumnType("integer");-- b.Property<string>("Filename")- .IsRequired()- .HasColumnType("text");-- b.Property<int>("Filesize")- .HasColumnType("integer");-- b.Property<string>("MimeType")- .IsRequired()- .HasColumnType("text");-- b.HasKey("Id");-- b.HasIndex("EmailId");-- b.ToTable("EmailAttachments");- });-- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Address")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("AddressDomain")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("AddressLocal")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("AnonymizedSenderCounted")- .HasColumnType("boolean");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("Address")- .IsUnique();-- b.ToTable("EmailClaims");- });-- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>- {- b.Property<Guid>("EmailClaimId")- .HasColumnType("uuid");-- b.Property<Guid>("VaultManifestId")- .HasColumnType("uuid");-- b.Property<string>("State")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.HasKey("EmailClaimId", "VaultManifestId");-- b.HasIndex("EmailClaimId")- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")- .HasFilter("\"State\" <> 'Removed'");-- b.HasIndex("VaultManifestId", "EmailClaimId");-- b.ToTable("EmailClaimLinks");- });-- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>- {- b.Property<int>("EmailId")- .HasColumnType("integer");-- b.Property<Guid>("VaultManifestDeliveryKeyId")- .HasColumnType("uuid");-- b.Property<string>("EncryptedSymmetricKey")- .IsRequired()- .HasColumnType("text");-- b.HasKey("EmailId", "VaultManifestDeliveryKeyId");-- b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");-- b.ToTable("EmailDecryptionKeys");- });-- modelBuilder.Entity("AliasServerDb.EmailPart", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<byte[]>("Bytes")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("EmailId")- .HasColumnType("integer");-- b.Property<int>("PartIndex")- .HasColumnType("integer");-- b.HasKey("Id");-- b.HasIndex("EmailId", "PartIndex")- .IsUnique();-- b.ToTable("EmailParts");- });-- modelBuilder.Entity("AliasServerDb.Group", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.PrimitiveCollection<int[]>("AnonymizedEmailAliasSenderCounts")- .IsRequired()- .ValueGeneratedOnAdd()- .HasColumnType("integer[]")- .HasDefaultValueSql("array_fill(0, ARRAY[64])");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("EmailsReceived")- .HasColumnType("integer");-- b.Property<int>("MaxEmailAgeDays")- .HasColumnType("integer");-- b.Property<int>("MaxEmails")- .HasColumnType("integer");-- b.Property<string>("Name")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("ShadowBlocked")- .HasColumnType("boolean");-- b.Property<DateTime?>("ShadowBlockedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("Type")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.ToTable("Groups");- });-- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedName")- .HasColumnType("text");-- b.Property<string>("EncryptedVek")- .HasColumnType("text");-- b.Property<Guid>("GroupId")- .HasColumnType("uuid");-- b.Property<string>("InviteeUserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("InviterUserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime?>("RespondedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("Role")- .HasColumnType("integer");-- b.Property<string>("State")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("UserGrantKeyId")- .HasColumnType("uuid");-- b.Property<int>("VaultKeyVersion")- .HasColumnType("integer");-- b.Property<Guid?>("VaultManifestId")- .HasColumnType("uuid");-- b.HasKey("Id");-- b.HasIndex("GroupId");-- b.HasIndex("InviterUserId");-- b.HasIndex("UserGrantKeyId");-- b.HasIndex("InviteeUserId", "State");-- b.HasIndex("VaultManifestId", "InviteeUserId")- .IsUnique()- .HasDatabaseName("UX_GroupInvitations_Manifest_Invitee_Pending")- .HasFilter("\"State\" = 'Pending'");-- b.ToTable("GroupInvitations");- });-- modelBuilder.Entity("AliasServerDb.GroupMember", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid>("GroupId")- .HasColumnType("uuid");-- b.Property<int>("Role")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId");-- b.HasIndex("GroupId", "UserId")- .IsUnique();-- b.ToTable("GroupMembers");- });-- modelBuilder.Entity("AliasServerDb.Log", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("Application")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("Exception")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Level")- .IsRequired()- .HasMaxLength(128)- .HasColumnType("character varying(128)");-- b.Property<string>("LogEvent")- .IsRequired()- .HasColumnType("text")- .HasColumnName("LogEvent");-- b.Property<string>("Message")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("MessageTemplate")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Properties")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("SourceContext")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("TimeStamp")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("Application");-- b.HasIndex("TimeStamp");-- b.ToTable("Logs", (string)null);- });-- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>- {- b.Property<string>("Id")- .HasColumnType("text");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime?>("ClearedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ClientIpAddress")- .HasColumnType("text");-- b.Property<string>("ClientPublicKey")- .IsRequired()- .HasColumnType("text");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedDecryptionKey")- .HasColumnType("text");-- b.Property<DateTime?>("FulfilledAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("MobileIpAddress")- .HasColumnType("text");-- b.Property<DateTime?>("RetrievedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .HasColumnType("text");-- b.HasKey("Id");-- b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");-- b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");-- b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");-- b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");-- b.HasIndex(new[] { "UserId" }, "IX_UserId");-- b.ToTable("MobileLoginRequests");- });-- modelBuilder.Entity("AliasServerDb.RateLimit", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int?>("AppliesToAccountAgeMaxDays")- .HasColumnType("integer");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("CreatedBy")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime?>("EffectiveFrom")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime?>("EffectiveUntil")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("Enabled")- .HasColumnType("boolean");-- b.Property<Guid?>("GroupId")- .HasColumnType("uuid");-- b.Property<int>("LimitType")- .HasColumnType("integer");-- b.Property<int>("MaxCount")- .HasColumnType("integer");-- b.Property<string>("Notes")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<int?>("Tier")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("WindowSeconds")- .HasColumnType("integer");-- b.HasKey("Id");-- b.HasIndex("GroupId");-- b.HasIndex("Tier");-- b.HasIndex("LimitType", "Enabled");-- b.ToTable("RateLimits");- });-- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>- {- b.Property<string>("Key")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Value")- .HasColumnType("text");-- b.HasKey("Key");-- b.ToTable("ServerSettings");- });-- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<TimeOnly?>("EndTime")- .HasColumnType("time without time zone");-- b.Property<string>("ErrorMessage")- .HasColumnType("text");-- b.Property<bool>("IsOnDemand")- .HasColumnType("boolean");-- b.Property<string>("Name")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("RunDate")- .HasColumnType("timestamp with time zone");-- b.Property<TimeOnly>("StartTime")- .HasColumnType("time without time zone");-- b.Property<int>("Status")- .HasColumnType("integer");-- b.HasKey("Id");-- b.ToTable("TaskRunnerJobs");- });-- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedPrivateKey")- .IsRequired()- .HasMaxLength(4000)- .HasColumnType("character varying(4000)");-- b.Property<bool>("IsPrimary")- .HasColumnType("boolean");-- b.Property<string>("PublicKey")- .IsRequired()- .HasMaxLength(2000)- .HasColumnType("character varying(2000)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId")- .IsUnique()- .HasDatabaseName("UX_UserGrantKeys_User_Primary")- .HasFilter("\"IsPrimary\"");-- b.ToTable("UserGrantKeys");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedAccountKey")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Label")- .IsRequired()- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<DateTime?>("LastUsedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Metadata")- .HasColumnType("jsonb");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId", "Type", "Label")- .IsUnique()- .HasDatabaseName("UX_UserUnlockKeys_UserId_Type_Label");-- b.ToTable("UserUnlockKeys");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("ArchivedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ArchivedByClient")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedAccountKey")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Label")- .IsRequired()- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("Metadata")- .HasColumnType("jsonb");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<Guid>("UnlockKeyId")- .HasColumnType("uuid");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("ArchivedAt")- .HasDatabaseName("IX_UserUnlockKeysHistory_ArchivedAt");-- b.HasIndex("UserId", "Type", "ArchivedAt")- .HasDatabaseName("IX_UserUnlockKeysHistory_UserId_Type_ArchivedAt");-- b.ToTable("UserUnlockKeysHistory", (string)null);- });-- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>- {- b.Property<string>("Hash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<string>("OwnerUserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Category")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<byte[]>("EncryptedData")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<int>("SizeBytes")- .HasColumnType("integer");-- b.HasKey("Hash", "OwnerUserId");-- b.HasIndex("OwnerUserId", "Category");-- b.ToTable("VaultBlobObjects");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("BlobHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");-- b.ToTable("VaultBlobReferences");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Category")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("CiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<byte[]>("EncryptedData")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("ManifestId", "Category");-- b.ToTable("VaultDataBuckets");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Category")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("CiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<byte[]>("EncryptedData")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("ManifestId", "Category", "RevisionNumber");-- b.ToTable("VaultDataBucketsHistory");- });-- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>- {- b.Property<Guid>("ManifestId")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Client")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("CredentialsCount")- .HasColumnType("integer");-- b.Property<int>("EmailClaimsCount")- .HasColumnType("integer");-- b.Property<string>("EncryptionSettings")- .HasColumnType("text");-- b.Property<string>("EncryptionType")- .HasColumnType("text");-- b.Property<int>("FileSize")- .HasColumnType("integer");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<byte[]>("ManifestBlob")- .HasColumnType("bytea");-- b.Property<string>("ManifestCiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<Guid>("OwnerGroupId")- .HasColumnType("uuid");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("Salt")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("StorageFormat")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("VaultBlob")- .HasColumnType("text");-- b.Property<string>("Verifier")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<string>("Version")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("ManifestId");-- b.HasIndex("OwnerGroupId");-- b.ToTable("VaultManifests");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int?>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedVek")- .IsRequired()- .HasColumnType("text");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<DateTime?>("LastUsedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Metadata")- .HasColumnType("jsonb");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("UserGrantKeyId")- .HasColumnType("uuid");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<Guid>("VaultManifestId")- .HasColumnType("uuid");-- b.HasKey("Id");-- b.HasIndex("UserGrantKeyId");-- b.HasIndex("VaultManifestId")- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");-- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")- .IsUnique()- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");-- b.ToTable("VaultManifestAccessKeys");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("IsPrimary")- .HasColumnType("boolean");-- b.Property<string>("PublicKey")- .IsRequired()- .HasMaxLength(2000)- .HasColumnType("character varying(2000)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid>("VaultManifestId")- .HasColumnType("uuid");-- b.HasKey("Id");-- b.HasIndex("VaultManifestId")- .IsUnique()- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")- .HasFilter("\"IsPrimary\"");-- b.HasIndex("VaultManifestId", "IsPrimary");-- b.ToTable("VaultManifestDeliveryKeys");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("Client")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("CredentialsCount")- .HasColumnType("integer");-- b.Property<int>("EmailClaimsCount")- .HasColumnType("integer");-- b.Property<string>("EncryptionSettings")- .HasColumnType("text");-- b.Property<string>("EncryptionType")- .HasColumnType("text");-- b.Property<int>("FileSize")- .HasColumnType("integer");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<byte[]>("ManifestBlob")- .HasColumnType("bytea");-- b.Property<string>("ManifestCiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<string>("Salt")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("StorageFormat")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("VaultBlob")- .HasColumnType("text");-- b.Property<string>("Verifier")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<string>("Version")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("ManifestId", "RevisionNumber");-- b.ToTable("VaultManifestsHistory", (string)null);- });-- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("CurrentStatus")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("DesiredStatus")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("Heartbeat")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ServiceName")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.ToTable("WorkerServiceStatuses");- });-- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("FriendlyName")- .HasColumnType("text");-- b.Property<string>("Xml")- .HasColumnType("text");-- b.HasKey("Id");-- b.ToTable("DataProtectionKeys");- });-- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("ClaimType")- .HasColumnType("text");-- b.Property<string>("ClaimValue")- .HasColumnType("text");-- b.Property<string>("UserId")- .HasColumnType("text");-- b.HasKey("Id");-- b.ToTable("UserClaims", (string)null);- });-- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>- {- b.Property<string>("UserId")- .HasColumnType("text");-- b.Property<string>("LoginProvider")- .HasColumnType("text");-- b.Property<string>("Name")- .HasColumnType("text");-- b.Property<string>("Value")- .HasColumnType("text");-- b.HasKey("UserId", "LoginProvider", "Name");-- b.ToTable("UserTokens", (string)null);- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>- {- b.HasOne("AliasServerDb.Group", "PersonalGroup")- .WithOne()- .HasForeignKey("AliasServerDb.AliasVaultUser", "PersonalGroupId")- .OnDelete(DeleteBehavior.Restrict)- .IsRequired();-- b.Navigation("PersonalGroup");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany()- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("Group");-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.ClientAction", b =>- {- b.HasOne("AliasServerDb.Group", "TargetGroup")- .WithMany()- .HasForeignKey("TargetGroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.HasOne("AliasServerDb.AliasVaultUser", "TargetUser")- .WithMany()- .HasForeignKey("TargetUserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("TargetGroup");-- b.Navigation("TargetUser");- });-- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>- {- b.HasOne("AliasServerDb.Email", "Email")- .WithMany("Attachments")- .HasForeignKey("EmailId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Email");- });-- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>- {- b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")- .WithMany("Links")- .HasForeignKey("EmailClaimId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")- .WithMany()- .HasForeignKey("VaultManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("EmailClaim");-- b.Navigation("VaultManifest");- });-- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>- {- b.HasOne("AliasServerDb.Email", "Email")- .WithMany("DecryptionKeys")- .HasForeignKey("EmailId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")- .WithMany("DecryptionKeys")- .HasForeignKey("VaultManifestDeliveryKeyId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired()- .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId");-- b.Navigation("Email");-- b.Navigation("VaultManifestDeliveryKey");- });-- modelBuilder.Entity("AliasServerDb.EmailPart", b =>- {- b.HasOne("AliasServerDb.Email", "Email")- .WithMany("Parts")- .HasForeignKey("EmailId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Email");- });-- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany()- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.AliasVaultUser", "Invitee")- .WithMany()- .HasForeignKey("InviteeUserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.AliasVaultUser", "Inviter")- .WithMany()- .HasForeignKey("InviterUserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")- .WithMany()- .HasForeignKey("UserGrantKeyId")- .OnDelete(DeleteBehavior.SetNull);-- b.Navigation("Group");-- b.Navigation("Invitee");-- b.Navigation("Inviter");-- b.Navigation("UserGrantKey");- });-- modelBuilder.Entity("AliasServerDb.GroupMember", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany("Members")- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Group");-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.RateLimit", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany()- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("Group");- });-- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("OwnerUserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>- {- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")- .WithMany()- .HasForeignKey("ManifestId", "Category")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Bucket");- });-- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>- {- b.HasOne("AliasServerDb.Group", "OwnerGroup")- .WithMany()- .HasForeignKey("OwnerGroupId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("OwnerGroup");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>- {- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")- .WithMany()- .HasForeignKey("UserGrantKeyId")- .OnDelete(DeleteBehavior.SetNull);-- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany("VaultManifestAccessKeys")- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");-- b.Navigation("UserGrantKey");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")- .WithMany()- .HasForeignKey("VaultManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("VaultManifest");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>- {- b.Navigation("VaultManifestAccessKeys");- });-- modelBuilder.Entity("AliasServerDb.Email", b =>- {- b.Navigation("Attachments");-- b.Navigation("DecryptionKeys");-- b.Navigation("Parts");- });-- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>- {- b.Navigation("Links");- });-- modelBuilder.Entity("AliasServerDb.Group", b =>- {- b.Navigation("Members");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>- {- b.Navigation("DecryptionKeys");- });-#pragma warning restore 612, 618- }- }-}diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260908151046_DropVaultBlobLastReferencedAt.cs b/apps/server/Databases/AliasServerDb/Migrations/20260908151046_DropVaultBlobLastReferencedAt.csdeleted file mode 100644index eca836cef..000000000--- a/apps/server/Databases/AliasServerDb/Migrations/20260908151046_DropVaultBlobLastReferencedAt.cs+++ /dev/null@@ -1,30 +0,0 @@-using System;-using Microsoft.EntityFrameworkCore.Migrations;--#nullable disable--namespace AliasServerDb.Migrations-{- /// <inheritdoc />- public partial class DropVaultBlobLastReferencedAt : Migration- {- /// <inheritdoc />- protected override void Up(MigrationBuilder migrationBuilder)- {- migrationBuilder.DropColumn(- name: "LastReferencedAt",- table: "VaultBlobObjects");- }-- /// <inheritdoc />- protected override void Down(MigrationBuilder migrationBuilder)- {- migrationBuilder.AddColumn<DateTime>(- name: "LastReferencedAt",- table: "VaultBlobObjects",- type: "timestamp with time zone",- nullable: false,- defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));- }- }-}diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260908153057_RemoveWorkerServiceStatusDesiredStatus.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260908153057_RemoveWorkerServiceStatusDesiredStatus.Designer.csdeleted file mode 100644index 34a3c0b1c..000000000--- a/apps/server/Databases/AliasServerDb/Migrations/20260908153057_RemoveWorkerServiceStatusDesiredStatus.Designer.cs+++ /dev/null@@ -1,2011 +0,0 @@-// <auto-generated />-using System;-using AliasServerDb;-using Microsoft.EntityFrameworkCore;-using Microsoft.EntityFrameworkCore.Infrastructure;-using Microsoft.EntityFrameworkCore.Migrations;-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;--#nullable disable--namespace AliasServerDb.Migrations-{- [DbContext(typeof(AliasServerDbContext))]- [Migration("20260908153057_RemoveWorkerServiceStatusDesiredStatus")]- partial class RemoveWorkerServiceStatusDesiredStatus- {- /// <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)- .HasAnnotation("Relational:MaxIdentifierLength", 63);-- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);-- modelBuilder.Entity("AliasServerDb.AdminUser", b =>- {- b.Property<string>("Id")- .HasColumnType("text");-- b.Property<int>("AccessFailedCount")- .HasColumnType("integer");-- b.Property<string>("ConcurrencyStamp")- .HasColumnType("text");-- b.Property<string>("Email")- .HasColumnType("text");-- b.Property<bool>("EmailConfirmed")- .HasColumnType("boolean");-- b.Property<DateTime?>("LastPasswordChanged")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("LockoutEnabled")- .HasColumnType("boolean");-- b.Property<DateTimeOffset?>("LockoutEnd")- .HasColumnType("timestamp with time zone");-- b.Property<string>("NormalizedEmail")- .HasColumnType("text");-- b.Property<string>("NormalizedUserName")- .HasColumnType("text");-- b.Property<string>("PasswordHash")- .HasColumnType("text");-- b.Property<string>("PhoneNumber")- .HasColumnType("text");-- b.Property<bool>("PhoneNumberConfirmed")- .HasColumnType("boolean");-- b.Property<string>("SecurityStamp")- .HasColumnType("text");-- b.Property<bool>("TwoFactorEnabled")- .HasColumnType("boolean");-- b.Property<string>("UserName")- .HasColumnType("text");-- b.HasKey("Id");-- b.ToTable("AdminUsers");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>- {- b.Property<string>("Id")- .HasColumnType("text");-- b.Property<int>("AccessFailedCount")- .HasColumnType("integer");-- b.Property<bool>("Blocked")- .HasColumnType("boolean");-- b.Property<DateTime?>("BlockedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ConcurrencyStamp")- .HasColumnType("text");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Email")- .HasColumnType("text");-- b.Property<bool>("EmailConfirmed")- .HasColumnType("boolean");-- b.Property<DateTime?>("LastActivityDate")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("LockoutEnabled")- .HasColumnType("boolean");-- b.Property<DateTimeOffset?>("LockoutEnd")- .HasColumnType("timestamp with time zone");-- b.Property<string>("NormalizedEmail")- .HasColumnType("text");-- b.Property<string>("NormalizedUserName")- .HasColumnType("text");-- b.Property<DateTime>("PasswordChangedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("PasswordHash")- .HasColumnType("text");-- b.Property<Guid>("PersonalGroupId")- .HasColumnType("uuid");-- b.Property<string>("PhoneNumber")- .HasColumnType("text");-- b.Property<bool>("PhoneNumberConfirmed")- .HasColumnType("boolean");-- b.Property<string>("SecurityStamp")- .HasColumnType("text");-- b.Property<string>("SrpIdentity")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("TwoFactorEnabled")- .HasColumnType("boolean");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserName")- .HasColumnType("text");-- b.HasKey("Id");-- b.HasIndex("PersonalGroupId")- .IsUnique()- .HasDatabaseName("UX_AliasVaultUsers_PersonalGroupId");-- b.ToTable("AliasVaultUsers");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("DeviceIdentifier")- .IsRequired()- .HasColumnType("text");-- b.Property<DateTime>("ExpireDate")- .HasMaxLength(255)- .HasColumnType("timestamp with time zone");-- b.Property<string>("IpAddress")- .HasMaxLength(45)- .HasColumnType("character varying(45)");-- b.Property<string>("PreviousTokenValue")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Value")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId");-- b.ToTable("AliasVaultUserRefreshTokens");- });-- modelBuilder.Entity("AliasServerDb.AuthLog", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("AdditionalInfo")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Browser")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("Client")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("Country")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("DeviceType")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<int>("EventType")- .HasColumnType("integer");-- b.Property<int?>("FailureReason")- .HasColumnType("integer");-- b.Property<string>("IpAddress")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<bool>("IsSuccess")- .HasColumnType("boolean");-- b.Property<bool>("IsSuspiciousActivity")- .HasColumnType("boolean");-- b.Property<string>("OperatingSystem")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("RequestPath")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("Timestamp")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Username")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex(new[] { "EventType" }, "IX_EventType");-- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");-- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");-- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")- .IsDescending(false, false, true);-- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")- .IsDescending(false, true);-- b.ToTable("AuthLogs");- });-- modelBuilder.Entity("AliasServerDb.BlockedIpRange", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<bool>("BlockLogin")- .HasColumnType("boolean");-- b.Property<bool>("BlockRegistration")- .HasColumnType("boolean");-- b.Property<bool>("BlockShadow")- .HasColumnType("boolean");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("CreatedBy")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("Enabled")- .HasColumnType("boolean");-- b.Property<string>("IpRange")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("Reason")- .HasMaxLength(500)- .HasColumnType("character varying(500)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex(new[] { "Enabled" }, "IX_BlockedIpRange_Enabled");-- b.HasIndex(new[] { "IpRange" }, "IX_BlockedIpRange_IpRange")- .IsUnique();-- b.ToTable("BlockedIpRanges");- });-- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("CapabilityKey")- .IsRequired()- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("ClientName")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("CreatedBy")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime?>("EffectiveFrom")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime?>("EffectiveUntil")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("Enabled")- .HasColumnType("boolean");-- b.Property<Guid?>("GroupId")- .HasColumnType("uuid");-- b.Property<string>("Kind")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<string>("Notes")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<string>("Tier")- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Value")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("GroupId");-- b.HasIndex("Tier");-- b.HasIndex("UserId");-- b.HasIndex("CapabilityKey", "Enabled");-- b.ToTable("CapabilityRules");- });-- modelBuilder.Entity("AliasServerDb.ClientAction", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Payload")- .HasColumnType("jsonb");-- b.Property<Guid?>("TargetGroupId")- .HasColumnType("uuid");-- b.Property<string>("TargetUserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("TargetGroupId");-- b.HasIndex("TargetUserId");-- b.ToTable("ClientActions");- });-- modelBuilder.Entity("AliasServerDb.Email", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<int>("AttachmentCount")- .HasColumnType("integer");-- b.Property<DateTime>("Date")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime>("DateSystem")- .HasColumnType("timestamp with time zone");-- b.Property<string>("From")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("FromDomain")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("FromLocal")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("MessageHtml")- .HasColumnType("text");-- b.Property<string>("MessagePlain")- .HasColumnType("text");-- b.Property<string>("MessagePreview")- .HasColumnType("text");-- b.Property<string>("MessageSource")- .HasColumnType("text");-- b.Property<byte[]>("MessageSourceBytes")- .HasColumnType("bytea");-- b.Property<bool>("PushNotificationSent")- .HasColumnType("boolean");-- b.Property<string>("Subject")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("To")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("ToDomain")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("ToLocal")- .IsRequired()- .HasColumnType("text");-- b.Property<bool>("Visible")- .HasColumnType("boolean");-- b.HasKey("Id");-- b.HasIndex("Date");-- b.HasIndex("DateSystem");-- b.HasIndex("PushNotificationSent");-- b.HasIndex("Visible");-- b.HasIndex("To", "DateSystem");-- b.ToTable("Emails");- });-- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<byte[]>("Bytes")- .IsRequired()- .HasColumnType("bytea");-- b.Property<DateTime>("Date")- .HasColumnType("timestamp with time zone");-- b.Property<int>("EmailId")- .HasColumnType("integer");-- b.Property<string>("Filename")- .IsRequired()- .HasColumnType("text");-- b.Property<int>("Filesize")- .HasColumnType("integer");-- b.Property<string>("MimeType")- .IsRequired()- .HasColumnType("text");-- b.HasKey("Id");-- b.HasIndex("EmailId");-- b.ToTable("EmailAttachments");- });-- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Address")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("AddressDomain")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("AddressLocal")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("AnonymizedSenderCounted")- .HasColumnType("boolean");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("Address")- .IsUnique();-- b.ToTable("EmailClaims");- });-- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>- {- b.Property<Guid>("EmailClaimId")- .HasColumnType("uuid");-- b.Property<Guid>("VaultManifestId")- .HasColumnType("uuid");-- b.Property<string>("State")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.HasKey("EmailClaimId", "VaultManifestId");-- b.HasIndex("EmailClaimId")- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")- .HasFilter("\"State\" <> 'Removed'");-- b.HasIndex("VaultManifestId", "EmailClaimId");-- b.ToTable("EmailClaimLinks");- });-- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>- {- b.Property<int>("EmailId")- .HasColumnType("integer");-- b.Property<Guid>("VaultManifestDeliveryKeyId")- .HasColumnType("uuid");-- b.Property<string>("EncryptedSymmetricKey")- .IsRequired()- .HasColumnType("text");-- b.HasKey("EmailId", "VaultManifestDeliveryKeyId");-- b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");-- b.ToTable("EmailDecryptionKeys");- });-- modelBuilder.Entity("AliasServerDb.EmailPart", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<byte[]>("Bytes")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("EmailId")- .HasColumnType("integer");-- b.Property<int>("PartIndex")- .HasColumnType("integer");-- b.HasKey("Id");-- b.HasIndex("EmailId", "PartIndex")- .IsUnique();-- b.ToTable("EmailParts");- });-- modelBuilder.Entity("AliasServerDb.Group", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.PrimitiveCollection<int[]>("AnonymizedEmailAliasSenderCounts")- .IsRequired()- .ValueGeneratedOnAdd()- .HasColumnType("integer[]")- .HasDefaultValueSql("array_fill(0, ARRAY[64])");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("EmailsReceived")- .HasColumnType("integer");-- b.Property<int>("MaxEmailAgeDays")- .HasColumnType("integer");-- b.Property<int>("MaxEmails")- .HasColumnType("integer");-- b.Property<string>("Name")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("ShadowBlocked")- .HasColumnType("boolean");-- b.Property<DateTime?>("ShadowBlockedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("Type")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.ToTable("Groups");- });-- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedName")- .HasColumnType("text");-- b.Property<string>("EncryptedVek")- .HasColumnType("text");-- b.Property<Guid>("GroupId")- .HasColumnType("uuid");-- b.Property<string>("InviteeUserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("InviterUserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime?>("RespondedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("Role")- .HasColumnType("integer");-- b.Property<string>("State")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("UserGrantKeyId")- .HasColumnType("uuid");-- b.Property<int>("VaultKeyVersion")- .HasColumnType("integer");-- b.Property<Guid?>("VaultManifestId")- .HasColumnType("uuid");-- b.HasKey("Id");-- b.HasIndex("GroupId");-- b.HasIndex("InviterUserId");-- b.HasIndex("UserGrantKeyId");-- b.HasIndex("InviteeUserId", "State");-- b.HasIndex("VaultManifestId", "InviteeUserId")- .IsUnique()- .HasDatabaseName("UX_GroupInvitations_Manifest_Invitee_Pending")- .HasFilter("\"State\" = 'Pending'");-- b.ToTable("GroupInvitations");- });-- modelBuilder.Entity("AliasServerDb.GroupMember", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid>("GroupId")- .HasColumnType("uuid");-- b.Property<int>("Role")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId");-- b.HasIndex("GroupId", "UserId")- .IsUnique();-- b.ToTable("GroupMembers");- });-- modelBuilder.Entity("AliasServerDb.Log", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("Application")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("Exception")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Level")- .IsRequired()- .HasMaxLength(128)- .HasColumnType("character varying(128)");-- b.Property<string>("LogEvent")- .IsRequired()- .HasColumnType("text")- .HasColumnName("LogEvent");-- b.Property<string>("Message")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("MessageTemplate")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Properties")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("SourceContext")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("TimeStamp")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("Application");-- b.HasIndex("TimeStamp");-- b.ToTable("Logs", (string)null);- });-- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>- {- b.Property<string>("Id")- .HasColumnType("text");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime?>("ClearedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ClientIpAddress")- .HasColumnType("text");-- b.Property<string>("ClientPublicKey")- .IsRequired()- .HasColumnType("text");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedDecryptionKey")- .HasColumnType("text");-- b.Property<DateTime?>("FulfilledAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("MobileIpAddress")- .HasColumnType("text");-- b.Property<DateTime?>("RetrievedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .HasColumnType("text");-- b.HasKey("Id");-- b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");-- b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");-- b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");-- b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");-- b.HasIndex(new[] { "UserId" }, "IX_UserId");-- b.ToTable("MobileLoginRequests");- });-- modelBuilder.Entity("AliasServerDb.RateLimit", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int?>("AppliesToAccountAgeMaxDays")- .HasColumnType("integer");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("CreatedBy")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime?>("EffectiveFrom")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime?>("EffectiveUntil")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("Enabled")- .HasColumnType("boolean");-- b.Property<Guid?>("GroupId")- .HasColumnType("uuid");-- b.Property<int>("LimitType")- .HasColumnType("integer");-- b.Property<int>("MaxCount")- .HasColumnType("integer");-- b.Property<string>("Notes")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<int?>("Tier")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("WindowSeconds")- .HasColumnType("integer");-- b.HasKey("Id");-- b.HasIndex("GroupId");-- b.HasIndex("Tier");-- b.HasIndex("LimitType", "Enabled");-- b.ToTable("RateLimits");- });-- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>- {- b.Property<string>("Key")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Value")- .HasColumnType("text");-- b.HasKey("Key");-- b.ToTable("ServerSettings");- });-- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<TimeOnly?>("EndTime")- .HasColumnType("time without time zone");-- b.Property<string>("ErrorMessage")- .HasColumnType("text");-- b.Property<bool>("IsOnDemand")- .HasColumnType("boolean");-- b.Property<string>("Name")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("RunDate")- .HasColumnType("timestamp with time zone");-- b.Property<TimeOnly>("StartTime")- .HasColumnType("time without time zone");-- b.Property<int>("Status")- .HasColumnType("integer");-- b.HasKey("Id");-- b.ToTable("TaskRunnerJobs");- });-- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedPrivateKey")- .IsRequired()- .HasMaxLength(4000)- .HasColumnType("character varying(4000)");-- b.Property<bool>("IsPrimary")- .HasColumnType("boolean");-- b.Property<string>("PublicKey")- .IsRequired()- .HasMaxLength(2000)- .HasColumnType("character varying(2000)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId")- .IsUnique()- .HasDatabaseName("UX_UserGrantKeys_User_Primary")- .HasFilter("\"IsPrimary\"");-- b.ToTable("UserGrantKeys");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedAccountKey")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Label")- .IsRequired()- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<DateTime?>("LastUsedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Metadata")- .HasColumnType("jsonb");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId", "Type", "Label")- .IsUnique()- .HasDatabaseName("UX_UserUnlockKeys_UserId_Type_Label");-- b.ToTable("UserUnlockKeys");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("ArchivedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ArchivedByClient")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedAccountKey")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Label")- .IsRequired()- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("Metadata")- .HasColumnType("jsonb");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<Guid>("UnlockKeyId")- .HasColumnType("uuid");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("ArchivedAt")- .HasDatabaseName("IX_UserUnlockKeysHistory_ArchivedAt");-- b.HasIndex("UserId", "Type", "ArchivedAt")- .HasDatabaseName("IX_UserUnlockKeysHistory_UserId_Type_ArchivedAt");-- b.ToTable("UserUnlockKeysHistory", (string)null);- });-- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>- {- b.Property<string>("Hash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<string>("OwnerUserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Category")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<byte[]>("EncryptedData")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<int>("SizeBytes")- .HasColumnType("integer");-- b.HasKey("Hash", "OwnerUserId");-- b.HasIndex("OwnerUserId", "Category");-- b.ToTable("VaultBlobObjects");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("BlobHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");-- b.ToTable("VaultBlobReferences");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Category")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("CiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<byte[]>("EncryptedData")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("ManifestId", "Category");-- b.ToTable("VaultDataBuckets");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Category")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("CiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<byte[]>("EncryptedData")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("ManifestId", "Category", "RevisionNumber");-- b.ToTable("VaultDataBucketsHistory");- });-- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>- {- b.Property<Guid>("ManifestId")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Client")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("CredentialsCount")- .HasColumnType("integer");-- b.Property<int>("EmailClaimsCount")- .HasColumnType("integer");-- b.Property<string>("EncryptionSettings")- .HasColumnType("text");-- b.Property<string>("EncryptionType")- .HasColumnType("text");-- b.Property<int>("FileSize")- .HasColumnType("integer");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<byte[]>("ManifestBlob")- .HasColumnType("bytea");-- b.Property<string>("ManifestCiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<Guid>("OwnerGroupId")- .HasColumnType("uuid");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("Salt")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("StorageFormat")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("VaultBlob")- .HasColumnType("text");-- b.Property<string>("Verifier")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<string>("Version")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("ManifestId");-- b.HasIndex("OwnerGroupId");-- b.ToTable("VaultManifests");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int?>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedVek")- .IsRequired()- .HasColumnType("text");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<DateTime?>("LastUsedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Metadata")- .HasColumnType("jsonb");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("UserGrantKeyId")- .HasColumnType("uuid");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<Guid>("VaultManifestId")- .HasColumnType("uuid");-- b.HasKey("Id");-- b.HasIndex("UserGrantKeyId");-- b.HasIndex("VaultManifestId")- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");-- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")- .IsUnique()- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");-- b.ToTable("VaultManifestAccessKeys");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("IsPrimary")- .HasColumnType("boolean");-- b.Property<string>("PublicKey")- .IsRequired()- .HasMaxLength(2000)- .HasColumnType("character varying(2000)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid>("VaultManifestId")- .HasColumnType("uuid");-- b.HasKey("Id");-- b.HasIndex("VaultManifestId")- .IsUnique()- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")- .HasFilter("\"IsPrimary\"");-- b.HasIndex("VaultManifestId", "IsPrimary");-- b.ToTable("VaultManifestDeliveryKeys");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("Client")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("CredentialsCount")- .HasColumnType("integer");-- b.Property<int>("EmailClaimsCount")- .HasColumnType("integer");-- b.Property<string>("EncryptionSettings")- .HasColumnType("text");-- b.Property<string>("EncryptionType")- .HasColumnType("text");-- b.Property<int>("FileSize")- .HasColumnType("integer");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<byte[]>("ManifestBlob")- .HasColumnType("bytea");-- b.Property<string>("ManifestCiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<string>("Salt")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("StorageFormat")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("VaultBlob")- .HasColumnType("text");-- b.Property<string>("Verifier")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<string>("Version")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("ManifestId", "RevisionNumber");-- b.ToTable("VaultManifestsHistory", (string)null);- });-- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("CurrentStatus")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("Heartbeat")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ServiceName")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.ToTable("WorkerServiceStatuses");- });-- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("FriendlyName")- .HasColumnType("text");-- b.Property<string>("Xml")- .HasColumnType("text");-- b.HasKey("Id");-- b.ToTable("DataProtectionKeys");- });-- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("ClaimType")- .HasColumnType("text");-- b.Property<string>("ClaimValue")- .HasColumnType("text");-- b.Property<string>("UserId")- .HasColumnType("text");-- b.HasKey("Id");-- b.ToTable("UserClaims", (string)null);- });-- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>- {- b.Property<string>("UserId")- .HasColumnType("text");-- b.Property<string>("LoginProvider")- .HasColumnType("text");-- b.Property<string>("Name")- .HasColumnType("text");-- b.Property<string>("Value")- .HasColumnType("text");-- b.HasKey("UserId", "LoginProvider", "Name");-- b.ToTable("UserTokens", (string)null);- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>- {- b.HasOne("AliasServerDb.Group", "PersonalGroup")- .WithOne()- .HasForeignKey("AliasServerDb.AliasVaultUser", "PersonalGroupId")- .OnDelete(DeleteBehavior.Restrict)- .IsRequired();-- b.Navigation("PersonalGroup");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany()- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("Group");-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.ClientAction", b =>- {- b.HasOne("AliasServerDb.Group", "TargetGroup")- .WithMany()- .HasForeignKey("TargetGroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.HasOne("AliasServerDb.AliasVaultUser", "TargetUser")- .WithMany()- .HasForeignKey("TargetUserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("TargetGroup");-- b.Navigation("TargetUser");- });-- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>- {- b.HasOne("AliasServerDb.Email", "Email")- .WithMany("Attachments")- .HasForeignKey("EmailId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Email");- });-- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>- {- b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")- .WithMany("Links")- .HasForeignKey("EmailClaimId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")- .WithMany()- .HasForeignKey("VaultManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("EmailClaim");-- b.Navigation("VaultManifest");- });-- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>- {- b.HasOne("AliasServerDb.Email", "Email")- .WithMany("DecryptionKeys")- .HasForeignKey("EmailId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")- .WithMany("DecryptionKeys")- .HasForeignKey("VaultManifestDeliveryKeyId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired()- .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId");-- b.Navigation("Email");-- b.Navigation("VaultManifestDeliveryKey");- });-- modelBuilder.Entity("AliasServerDb.EmailPart", b =>- {- b.HasOne("AliasServerDb.Email", "Email")- .WithMany("Parts")- .HasForeignKey("EmailId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Email");- });-- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany()- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.AliasVaultUser", "Invitee")- .WithMany()- .HasForeignKey("InviteeUserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.AliasVaultUser", "Inviter")- .WithMany()- .HasForeignKey("InviterUserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")- .WithMany()- .HasForeignKey("UserGrantKeyId")- .OnDelete(DeleteBehavior.SetNull);-- b.Navigation("Group");-- b.Navigation("Invitee");-- b.Navigation("Inviter");-- b.Navigation("UserGrantKey");- });-- modelBuilder.Entity("AliasServerDb.GroupMember", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany("Members")- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Group");-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.RateLimit", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany()- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("Group");- });-- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("OwnerUserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>- {- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")- .WithMany()- .HasForeignKey("ManifestId", "Category")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Bucket");- });-- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>- {- b.HasOne("AliasServerDb.Group", "OwnerGroup")- .WithMany()- .HasForeignKey("OwnerGroupId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("OwnerGroup");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>- {- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")- .WithMany()- .HasForeignKey("UserGrantKeyId")- .OnDelete(DeleteBehavior.SetNull);-- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany("VaultManifestAccessKeys")- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");-- b.Navigation("UserGrantKey");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")- .WithMany()- .HasForeignKey("VaultManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("VaultManifest");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>- {- b.Navigation("VaultManifestAccessKeys");- });-- modelBuilder.Entity("AliasServerDb.Email", b =>- {- b.Navigation("Attachments");-- b.Navigation("DecryptionKeys");-- b.Navigation("Parts");- });-- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>- {- b.Navigation("Links");- });-- modelBuilder.Entity("AliasServerDb.Group", b =>- {- b.Navigation("Members");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>- {- b.Navigation("DecryptionKeys");- });-#pragma warning restore 612, 618- }- }-}diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260908153057_RemoveWorkerServiceStatusDesiredStatus.cs b/apps/server/Databases/AliasServerDb/Migrations/20260908153057_RemoveWorkerServiceStatusDesiredStatus.csdeleted file mode 100644index 0de185b1d..000000000--- a/apps/server/Databases/AliasServerDb/Migrations/20260908153057_RemoveWorkerServiceStatusDesiredStatus.cs+++ /dev/null@@ -1,30 +0,0 @@-using Microsoft.EntityFrameworkCore.Migrations;--#nullable disable--namespace AliasServerDb.Migrations-{- /// <inheritdoc />- public partial class RemoveWorkerServiceStatusDesiredStatus : Migration- {- /// <inheritdoc />- protected override void Up(MigrationBuilder migrationBuilder)- {- migrationBuilder.DropColumn(- name: "DesiredStatus",- table: "WorkerServiceStatuses");- }-- /// <inheritdoc />- protected override void Down(MigrationBuilder migrationBuilder)- {- migrationBuilder.AddColumn<string>(- name: "DesiredStatus",- table: "WorkerServiceStatuses",- type: "character varying(50)",- maxLength: 50,- nullable: false,- defaultValue: "");- }- }-}diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260917141654_RekeyVaultBlobObjectsOnManifest.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260917141654_RekeyVaultBlobObjectsOnManifest.Designer.csdeleted file mode 100644index 2b0177411..000000000--- a/apps/server/Databases/AliasServerDb/Migrations/20260917141654_RekeyVaultBlobObjectsOnManifest.Designer.cs+++ /dev/null@@ -1,2008 +0,0 @@-// <auto-generated />-using System;-using AliasServerDb;-using Microsoft.EntityFrameworkCore;-using Microsoft.EntityFrameworkCore.Infrastructure;-using Microsoft.EntityFrameworkCore.Migrations;-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;--#nullable disable--namespace AliasServerDb.Migrations-{- [DbContext(typeof(AliasServerDbContext))]- [Migration("20260917141654_RekeyVaultBlobObjectsOnManifest")]- partial class RekeyVaultBlobObjectsOnManifest- {- /// <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)- .HasAnnotation("Relational:MaxIdentifierLength", 63);-- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);-- modelBuilder.Entity("AliasServerDb.AdminUser", b =>- {- b.Property<string>("Id")- .HasColumnType("text");-- b.Property<int>("AccessFailedCount")- .HasColumnType("integer");-- b.Property<string>("ConcurrencyStamp")- .HasColumnType("text");-- b.Property<string>("Email")- .HasColumnType("text");-- b.Property<bool>("EmailConfirmed")- .HasColumnType("boolean");-- b.Property<DateTime?>("LastPasswordChanged")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("LockoutEnabled")- .HasColumnType("boolean");-- b.Property<DateTimeOffset?>("LockoutEnd")- .HasColumnType("timestamp with time zone");-- b.Property<string>("NormalizedEmail")- .HasColumnType("text");-- b.Property<string>("NormalizedUserName")- .HasColumnType("text");-- b.Property<string>("PasswordHash")- .HasColumnType("text");-- b.Property<string>("PhoneNumber")- .HasColumnType("text");-- b.Property<bool>("PhoneNumberConfirmed")- .HasColumnType("boolean");-- b.Property<string>("SecurityStamp")- .HasColumnType("text");-- b.Property<bool>("TwoFactorEnabled")- .HasColumnType("boolean");-- b.Property<string>("UserName")- .HasColumnType("text");-- b.HasKey("Id");-- b.ToTable("AdminUsers");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>- {- b.Property<string>("Id")- .HasColumnType("text");-- b.Property<int>("AccessFailedCount")- .HasColumnType("integer");-- b.Property<bool>("Blocked")- .HasColumnType("boolean");-- b.Property<DateTime?>("BlockedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ConcurrencyStamp")- .HasColumnType("text");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Email")- .HasColumnType("text");-- b.Property<bool>("EmailConfirmed")- .HasColumnType("boolean");-- b.Property<DateTime?>("LastActivityDate")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("LockoutEnabled")- .HasColumnType("boolean");-- b.Property<DateTimeOffset?>("LockoutEnd")- .HasColumnType("timestamp with time zone");-- b.Property<string>("NormalizedEmail")- .HasColumnType("text");-- b.Property<string>("NormalizedUserName")- .HasColumnType("text");-- b.Property<DateTime>("PasswordChangedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("PasswordHash")- .HasColumnType("text");-- b.Property<Guid>("PersonalGroupId")- .HasColumnType("uuid");-- b.Property<string>("PhoneNumber")- .HasColumnType("text");-- b.Property<bool>("PhoneNumberConfirmed")- .HasColumnType("boolean");-- b.Property<string>("SecurityStamp")- .HasColumnType("text");-- b.Property<string>("SrpIdentity")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("TwoFactorEnabled")- .HasColumnType("boolean");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserName")- .HasColumnType("text");-- b.HasKey("Id");-- b.HasIndex("PersonalGroupId")- .IsUnique()- .HasDatabaseName("UX_AliasVaultUsers_PersonalGroupId");-- b.ToTable("AliasVaultUsers");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("DeviceIdentifier")- .IsRequired()- .HasColumnType("text");-- b.Property<DateTime>("ExpireDate")- .HasMaxLength(255)- .HasColumnType("timestamp with time zone");-- b.Property<string>("IpAddress")- .HasMaxLength(45)- .HasColumnType("character varying(45)");-- b.Property<string>("PreviousTokenValue")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Value")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId");-- b.ToTable("AliasVaultUserRefreshTokens");- });-- modelBuilder.Entity("AliasServerDb.AuthLog", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("AdditionalInfo")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Browser")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("Client")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("Country")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("DeviceType")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<int>("EventType")- .HasColumnType("integer");-- b.Property<int?>("FailureReason")- .HasColumnType("integer");-- b.Property<string>("IpAddress")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<bool>("IsSuccess")- .HasColumnType("boolean");-- b.Property<bool>("IsSuspiciousActivity")- .HasColumnType("boolean");-- b.Property<string>("OperatingSystem")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("RequestPath")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("Timestamp")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Username")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex(new[] { "EventType" }, "IX_EventType");-- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");-- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");-- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")- .IsDescending(false, false, true);-- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")- .IsDescending(false, true);-- b.ToTable("AuthLogs");- });-- modelBuilder.Entity("AliasServerDb.BlockedIpRange", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<bool>("BlockLogin")- .HasColumnType("boolean");-- b.Property<bool>("BlockRegistration")- .HasColumnType("boolean");-- b.Property<bool>("BlockShadow")- .HasColumnType("boolean");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("CreatedBy")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("Enabled")- .HasColumnType("boolean");-- b.Property<string>("IpRange")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("Reason")- .HasMaxLength(500)- .HasColumnType("character varying(500)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex(new[] { "Enabled" }, "IX_BlockedIpRange_Enabled");-- b.HasIndex(new[] { "IpRange" }, "IX_BlockedIpRange_IpRange")- .IsUnique();-- b.ToTable("BlockedIpRanges");- });-- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("CapabilityKey")- .IsRequired()- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("ClientName")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("CreatedBy")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime?>("EffectiveFrom")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime?>("EffectiveUntil")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("Enabled")- .HasColumnType("boolean");-- b.Property<Guid?>("GroupId")- .HasColumnType("uuid");-- b.Property<string>("Kind")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<string>("Notes")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<string>("Tier")- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Value")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("GroupId");-- b.HasIndex("Tier");-- b.HasIndex("UserId");-- b.HasIndex("CapabilityKey", "Enabled");-- b.ToTable("CapabilityRules");- });-- modelBuilder.Entity("AliasServerDb.ClientAction", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Payload")- .HasColumnType("jsonb");-- b.Property<Guid?>("TargetGroupId")- .HasColumnType("uuid");-- b.Property<string>("TargetUserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("TargetGroupId");-- b.HasIndex("TargetUserId");-- b.ToTable("ClientActions");- });-- modelBuilder.Entity("AliasServerDb.Email", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<int>("AttachmentCount")- .HasColumnType("integer");-- b.Property<DateTime>("Date")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime>("DateSystem")- .HasColumnType("timestamp with time zone");-- b.Property<string>("From")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("FromDomain")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("FromLocal")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("MessageHtml")- .HasColumnType("text");-- b.Property<string>("MessagePlain")- .HasColumnType("text");-- b.Property<string>("MessagePreview")- .HasColumnType("text");-- b.Property<string>("MessageSource")- .HasColumnType("text");-- b.Property<byte[]>("MessageSourceBytes")- .HasColumnType("bytea");-- b.Property<bool>("PushNotificationSent")- .HasColumnType("boolean");-- b.Property<string>("Subject")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("To")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("ToDomain")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("ToLocal")- .IsRequired()- .HasColumnType("text");-- b.Property<bool>("Visible")- .HasColumnType("boolean");-- b.HasKey("Id");-- b.HasIndex("Date");-- b.HasIndex("DateSystem");-- b.HasIndex("PushNotificationSent");-- b.HasIndex("Visible");-- b.HasIndex("To", "DateSystem");-- b.ToTable("Emails");- });-- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<byte[]>("Bytes")- .IsRequired()- .HasColumnType("bytea");-- b.Property<DateTime>("Date")- .HasColumnType("timestamp with time zone");-- b.Property<int>("EmailId")- .HasColumnType("integer");-- b.Property<string>("Filename")- .IsRequired()- .HasColumnType("text");-- b.Property<int>("Filesize")- .HasColumnType("integer");-- b.Property<string>("MimeType")- .IsRequired()- .HasColumnType("text");-- b.HasKey("Id");-- b.HasIndex("EmailId");-- b.ToTable("EmailAttachments");- });-- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Address")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("AddressDomain")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("AddressLocal")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("AnonymizedSenderCounted")- .HasColumnType("boolean");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("Address")- .IsUnique();-- b.ToTable("EmailClaims");- });-- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>- {- b.Property<Guid>("EmailClaimId")- .HasColumnType("uuid");-- b.Property<Guid>("VaultManifestId")- .HasColumnType("uuid");-- b.Property<string>("State")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.HasKey("EmailClaimId", "VaultManifestId");-- b.HasIndex("EmailClaimId")- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")- .HasFilter("\"State\" <> 'Removed'");-- b.HasIndex("VaultManifestId", "EmailClaimId");-- b.ToTable("EmailClaimLinks");- });-- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>- {- b.Property<int>("EmailId")- .HasColumnType("integer");-- b.Property<Guid>("VaultManifestDeliveryKeyId")- .HasColumnType("uuid");-- b.Property<string>("EncryptedSymmetricKey")- .IsRequired()- .HasColumnType("text");-- b.HasKey("EmailId", "VaultManifestDeliveryKeyId");-- b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");-- b.ToTable("EmailDecryptionKeys");- });-- modelBuilder.Entity("AliasServerDb.EmailPart", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<byte[]>("Bytes")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("EmailId")- .HasColumnType("integer");-- b.Property<int>("PartIndex")- .HasColumnType("integer");-- b.HasKey("Id");-- b.HasIndex("EmailId", "PartIndex")- .IsUnique();-- b.ToTable("EmailParts");- });-- modelBuilder.Entity("AliasServerDb.Group", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.PrimitiveCollection<int[]>("AnonymizedEmailAliasSenderCounts")- .IsRequired()- .ValueGeneratedOnAdd()- .HasColumnType("integer[]")- .HasDefaultValueSql("array_fill(0, ARRAY[64])");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("EmailsReceived")- .HasColumnType("integer");-- b.Property<int>("MaxEmailAgeDays")- .HasColumnType("integer");-- b.Property<int>("MaxEmails")- .HasColumnType("integer");-- b.Property<string>("Name")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<bool>("ShadowBlocked")- .HasColumnType("boolean");-- b.Property<DateTime?>("ShadowBlockedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("Type")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.ToTable("Groups");- });-- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedName")- .HasColumnType("text");-- b.Property<string>("EncryptedVek")- .HasColumnType("text");-- b.Property<Guid>("GroupId")- .HasColumnType("uuid");-- b.Property<string>("InviteeUserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("InviterUserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime?>("RespondedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("Role")- .HasColumnType("integer");-- b.Property<string>("State")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("UserGrantKeyId")- .HasColumnType("uuid");-- b.Property<int>("VaultKeyVersion")- .HasColumnType("integer");-- b.Property<Guid?>("VaultManifestId")- .HasColumnType("uuid");-- b.HasKey("Id");-- b.HasIndex("GroupId");-- b.HasIndex("InviterUserId");-- b.HasIndex("UserGrantKeyId");-- b.HasIndex("InviteeUserId", "State");-- b.HasIndex("VaultManifestId", "InviteeUserId")- .IsUnique()- .HasDatabaseName("UX_GroupInvitations_Manifest_Invitee_Pending")- .HasFilter("\"State\" = 'Pending'");-- b.ToTable("GroupInvitations");- });-- modelBuilder.Entity("AliasServerDb.GroupMember", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid>("GroupId")- .HasColumnType("uuid");-- b.Property<int>("Role")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId");-- b.HasIndex("GroupId", "UserId")- .IsUnique();-- b.ToTable("GroupMembers");- });-- modelBuilder.Entity("AliasServerDb.Log", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("Application")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("Exception")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Level")- .IsRequired()- .HasMaxLength(128)- .HasColumnType("character varying(128)");-- b.Property<string>("LogEvent")- .IsRequired()- .HasColumnType("text")- .HasColumnName("LogEvent");-- b.Property<string>("Message")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("MessageTemplate")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Properties")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("SourceContext")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("TimeStamp")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("Application");-- b.HasIndex("TimeStamp");-- b.ToTable("Logs", (string)null);- });-- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>- {- b.Property<string>("Id")- .HasColumnType("text");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime?>("ClearedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ClientIpAddress")- .HasColumnType("text");-- b.Property<string>("ClientPublicKey")- .IsRequired()- .HasColumnType("text");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedDecryptionKey")- .HasColumnType("text");-- b.Property<DateTime?>("FulfilledAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("MobileIpAddress")- .HasColumnType("text");-- b.Property<DateTime?>("RetrievedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .HasColumnType("text");-- b.HasKey("Id");-- b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");-- b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");-- b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");-- b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");-- b.HasIndex(new[] { "UserId" }, "IX_UserId");-- b.ToTable("MobileLoginRequests");- });-- modelBuilder.Entity("AliasServerDb.RateLimit", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int?>("AppliesToAccountAgeMaxDays")- .HasColumnType("integer");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("CreatedBy")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime?>("EffectiveFrom")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime?>("EffectiveUntil")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("Enabled")- .HasColumnType("boolean");-- b.Property<Guid?>("GroupId")- .HasColumnType("uuid");-- b.Property<int>("LimitType")- .HasColumnType("integer");-- b.Property<int>("MaxCount")- .HasColumnType("integer");-- b.Property<string>("Notes")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<int?>("Tier")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("WindowSeconds")- .HasColumnType("integer");-- b.HasKey("Id");-- b.HasIndex("GroupId");-- b.HasIndex("Tier");-- b.HasIndex("LimitType", "Enabled");-- b.ToTable("RateLimits");- });-- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>- {- b.Property<string>("Key")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Value")- .HasColumnType("text");-- b.HasKey("Key");-- b.ToTable("ServerSettings");- });-- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<TimeOnly?>("EndTime")- .HasColumnType("time without time zone");-- b.Property<string>("ErrorMessage")- .HasColumnType("text");-- b.Property<bool>("IsOnDemand")- .HasColumnType("boolean");-- b.Property<string>("Name")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("RunDate")- .HasColumnType("timestamp with time zone");-- b.Property<TimeOnly>("StartTime")- .HasColumnType("time without time zone");-- b.Property<int>("Status")- .HasColumnType("integer");-- b.HasKey("Id");-- b.ToTable("TaskRunnerJobs");- });-- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedPrivateKey")- .IsRequired()- .HasMaxLength(4000)- .HasColumnType("character varying(4000)");-- b.Property<bool>("IsPrimary")- .HasColumnType("boolean");-- b.Property<string>("PublicKey")- .IsRequired()- .HasMaxLength(2000)- .HasColumnType("character varying(2000)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId")- .IsUnique()- .HasDatabaseName("UX_UserGrantKeys_User_Primary")- .HasFilter("\"IsPrimary\"");-- b.ToTable("UserGrantKeys");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedAccountKey")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Label")- .IsRequired()- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<DateTime?>("LastUsedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Metadata")- .HasColumnType("jsonb");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("UserId", "Type", "Label")- .IsUnique()- .HasDatabaseName("UX_UserUnlockKeys_UserId_Type_Label");-- b.ToTable("UserUnlockKeys");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("ArchivedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ArchivedByClient")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedAccountKey")- .IsRequired()- .HasColumnType("text");-- b.Property<string>("Label")- .IsRequired()- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("Metadata")- .HasColumnType("jsonb");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<Guid>("UnlockKeyId")- .HasColumnType("uuid");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.HasIndex("ArchivedAt")- .HasDatabaseName("IX_UserUnlockKeysHistory_ArchivedAt");-- b.HasIndex("UserId", "Type", "ArchivedAt")- .HasDatabaseName("IX_UserUnlockKeysHistory_UserId_Type_ArchivedAt");-- b.ToTable("UserUnlockKeysHistory", (string)null);- });-- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Hash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<string>("Category")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<byte[]>("EncryptedData")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<int>("SizeBytes")- .HasColumnType("integer");-- b.HasKey("ManifestId", "Hash");-- b.ToTable("VaultBlobObjects");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("BlobHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");-- b.ToTable("VaultBlobReferences");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Category")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<string>("CiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<byte[]>("EncryptedData")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("ManifestId", "Category");-- b.ToTable("VaultDataBuckets");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Category")- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("CiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<byte[]>("EncryptedData")- .IsRequired()- .HasColumnType("bytea");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("ManifestId", "Category", "RevisionNumber");-- b.ToTable("VaultDataBucketsHistory");- });-- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>- {- b.Property<Guid>("ManifestId")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Client")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("CredentialsCount")- .HasColumnType("integer");-- b.Property<int>("EmailClaimsCount")- .HasColumnType("integer");-- b.Property<string>("EncryptionSettings")- .HasColumnType("text");-- b.Property<string>("EncryptionType")- .HasColumnType("text");-- b.Property<int>("FileSize")- .HasColumnType("integer");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<byte[]>("ManifestBlob")- .HasColumnType("bytea");-- b.Property<string>("ManifestCiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<Guid>("OwnerGroupId")- .HasColumnType("uuid");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("Salt")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("StorageFormat")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("VaultBlob")- .HasColumnType("text");-- b.Property<string>("Verifier")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<string>("Version")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("ManifestId");-- b.HasIndex("OwnerGroupId");-- b.ToTable("VaultManifests");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<int?>("AccountKeyVersion")- .HasColumnType("integer");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("EncryptedVek")- .IsRequired()- .HasColumnType("text");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<DateTime?>("LastUsedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("Metadata")- .HasColumnType("jsonb");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("UserGrantKeyId")- .HasColumnType("uuid");-- b.Property<string>("UserId")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<Guid>("VaultManifestId")- .HasColumnType("uuid");-- b.HasKey("Id");-- b.HasIndex("UserGrantKeyId");-- b.HasIndex("VaultManifestId")- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");-- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")- .IsUnique()- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");-- b.ToTable("VaultManifestAccessKeys");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<string>("Algorithm")- .IsRequired()- .HasMaxLength(30)- .HasColumnType("character varying(30)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<bool>("IsPrimary")- .HasColumnType("boolean");-- b.Property<string>("PublicKey")- .IsRequired()- .HasMaxLength(2000)- .HasColumnType("character varying(2000)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid>("VaultManifestId")- .HasColumnType("uuid");-- b.HasKey("Id");-- b.HasIndex("VaultManifestId")- .IsUnique()- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")- .HasFilter("\"IsPrimary\"");-- b.HasIndex("VaultManifestId", "IsPrimary");-- b.ToTable("VaultManifestDeliveryKeys");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>- {- b.Property<Guid>("ManifestId")- .HasColumnType("uuid");-- b.Property<long>("RevisionNumber")- .HasColumnType("bigint");-- b.Property<string>("Client")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<int>("CredentialsCount")- .HasColumnType("integer");-- b.Property<int>("EmailClaimsCount")- .HasColumnType("integer");-- b.Property<string>("EncryptionSettings")- .HasColumnType("text");-- b.Property<string>("EncryptionType")- .HasColumnType("text");-- b.Property<int>("FileSize")- .HasColumnType("integer");-- b.Property<int>("KeyVersion")- .HasColumnType("integer");-- b.Property<byte[]>("ManifestBlob")- .HasColumnType("bytea");-- b.Property<string>("ManifestCiphertextHash")- .HasMaxLength(64)- .HasColumnType("character varying(64)");-- b.Property<string>("Salt")- .HasMaxLength(100)- .HasColumnType("character varying(100)");-- b.Property<string>("StorageFormat")- .IsRequired()- .HasMaxLength(20)- .HasColumnType("character varying(20)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<string>("VaultBlob")- .HasColumnType("text");-- b.Property<string>("Verifier")- .HasMaxLength(1000)- .HasColumnType("character varying(1000)");-- b.Property<string>("Version")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("ManifestId", "RevisionNumber");-- b.ToTable("VaultManifestsHistory", (string)null);- });-- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("CurrentStatus")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("Heartbeat")- .HasColumnType("timestamp with time zone");-- b.Property<string>("ServiceName")- .IsRequired()- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.HasKey("Id");-- b.ToTable("WorkerServiceStatuses");- });-- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("FriendlyName")- .HasColumnType("text");-- b.Property<string>("Xml")- .HasColumnType("text");-- b.HasKey("Id");-- b.ToTable("DataProtectionKeys");- });-- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>- {- b.Property<int>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("integer");-- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));-- b.Property<string>("ClaimType")- .HasColumnType("text");-- b.Property<string>("ClaimValue")- .HasColumnType("text");-- b.Property<string>("UserId")- .HasColumnType("text");-- b.HasKey("Id");-- b.ToTable("UserClaims", (string)null);- });-- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>- {- b.Property<string>("UserId")- .HasColumnType("text");-- b.Property<string>("LoginProvider")- .HasColumnType("text");-- b.Property<string>("Name")- .HasColumnType("text");-- b.Property<string>("Value")- .HasColumnType("text");-- b.HasKey("UserId", "LoginProvider", "Name");-- b.ToTable("UserTokens", (string)null);- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>- {- b.HasOne("AliasServerDb.Group", "PersonalGroup")- .WithOne()- .HasForeignKey("AliasServerDb.AliasVaultUser", "PersonalGroupId")- .OnDelete(DeleteBehavior.Restrict)- .IsRequired();-- b.Navigation("PersonalGroup");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany()- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("Group");-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.ClientAction", b =>- {- b.HasOne("AliasServerDb.Group", "TargetGroup")- .WithMany()- .HasForeignKey("TargetGroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.HasOne("AliasServerDb.AliasVaultUser", "TargetUser")- .WithMany()- .HasForeignKey("TargetUserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("TargetGroup");-- b.Navigation("TargetUser");- });-- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>- {- b.HasOne("AliasServerDb.Email", "Email")- .WithMany("Attachments")- .HasForeignKey("EmailId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Email");- });-- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>- {- b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")- .WithMany("Links")- .HasForeignKey("EmailClaimId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")- .WithMany()- .HasForeignKey("VaultManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("EmailClaim");-- b.Navigation("VaultManifest");- });-- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>- {- b.HasOne("AliasServerDb.Email", "Email")- .WithMany("DecryptionKeys")- .HasForeignKey("EmailId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")- .WithMany("DecryptionKeys")- .HasForeignKey("VaultManifestDeliveryKeyId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired()- .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId");-- b.Navigation("Email");-- b.Navigation("VaultManifestDeliveryKey");- });-- modelBuilder.Entity("AliasServerDb.EmailPart", b =>- {- b.HasOne("AliasServerDb.Email", "Email")- .WithMany("Parts")- .HasForeignKey("EmailId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Email");- });-- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany()- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.AliasVaultUser", "Invitee")- .WithMany()- .HasForeignKey("InviteeUserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.AliasVaultUser", "Inviter")- .WithMany()- .HasForeignKey("InviterUserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")- .WithMany()- .HasForeignKey("UserGrantKeyId")- .OnDelete(DeleteBehavior.SetNull);-- b.Navigation("Group");-- b.Navigation("Invitee");-- b.Navigation("Inviter");-- b.Navigation("UserGrantKey");- });-- modelBuilder.Entity("AliasServerDb.GroupMember", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany("Members")- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Group");-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.RateLimit", b =>- {- b.HasOne("AliasServerDb.Group", "Group")- .WithMany()- .HasForeignKey("GroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("Group");- });-- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.UserUnlockKeysHistory", b =>- {- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany()- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>- {- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")- .WithMany()- .HasForeignKey("ManifestId", "Category")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Bucket");- });-- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>- {- b.HasOne("AliasServerDb.Group", "OwnerGroup")- .WithMany()- .HasForeignKey("OwnerGroupId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("OwnerGroup");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>- {- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")- .WithMany()- .HasForeignKey("UserGrantKeyId")- .OnDelete(DeleteBehavior.SetNull);-- b.HasOne("AliasServerDb.AliasVaultUser", "User")- .WithMany("VaultManifestAccessKeys")- .HasForeignKey("UserId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("User");-- b.Navigation("UserGrantKey");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")- .WithMany()- .HasForeignKey("VaultManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("VaultManifest");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>- {- b.HasOne("AliasServerDb.VaultManifest", "Manifest")- .WithMany()- .HasForeignKey("ManifestId")- .OnDelete(DeleteBehavior.Cascade)- .IsRequired();-- b.Navigation("Manifest");- });-- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>- {- b.Navigation("VaultManifestAccessKeys");- });-- modelBuilder.Entity("AliasServerDb.Email", b =>- {- b.Navigation("Attachments");-- b.Navigation("DecryptionKeys");-- b.Navigation("Parts");- });-- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>- {- b.Navigation("Links");- });-- modelBuilder.Entity("AliasServerDb.Group", b =>- {- b.Navigation("Members");- });-- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>- {- b.Navigation("DecryptionKeys");- });-#pragma warning restore 612, 618- }- }-}diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260917141654_RekeyVaultBlobObjectsOnManifest.cs b/apps/server/Databases/AliasServerDb/Migrations/20260917141654_RekeyVaultBlobObjectsOnManifest.csdeleted file mode 100644index a7c29b899..000000000--- a/apps/server/Databases/AliasServerDb/Migrations/20260917141654_RekeyVaultBlobObjectsOnManifest.cs+++ /dev/null@@ -1,140 +0,0 @@-using System;-using Microsoft.EntityFrameworkCore.Migrations;--#nullable disable--namespace AliasServerDb.Migrations-{- /// <inheritdoc />- public partial class RekeyVaultBlobObjectsOnManifest : Migration- {- /// <inheritdoc />- protected override void Up(MigrationBuilder migrationBuilder)- {- migrationBuilder.DropForeignKey(- name: "FK_VaultBlobObjects_AliasVaultUsers_OwnerUserId",- table: "VaultBlobObjects");-- migrationBuilder.DropPrimaryKey(- name: "PK_VaultBlobObjects",- table: "VaultBlobObjects");-- migrationBuilder.DropIndex(- name: "IX_VaultBlobObjects_OwnerUserId_Category",- table: "VaultBlobObjects");-- migrationBuilder.AddColumn<Guid>(- name: "ManifestId",- table: "VaultBlobObjects",- type: "uuid",- nullable: true);-- // A blob moves to every manifest that references its hash. When several members stored the same hash, the- // copy of the manifest's own user wins, then the oldest. A personal manifest only takes its own user's copy.- migrationBuilder.Sql("""- INSERT INTO "VaultBlobObjects" ("Hash", "OwnerUserId", "ManifestId", "Category", "EncryptedData", "SizeBytes", "KeyVersion", "CreatedAt")- SELECT DISTINCT ON (r."ManifestId", b."Hash") b."Hash", b."OwnerUserId", r."ManifestId", b."Category", b."EncryptedData", b."SizeBytes", b."KeyVersion", b."CreatedAt"- FROM "VaultBlobObjects" b- JOIN (SELECT DISTINCT "ManifestId", "BlobHash" FROM "VaultBlobReferences") r ON r."BlobHash" = b."Hash"- JOIN "VaultManifests" m ON m."ManifestId" = r."ManifestId"- JOIN "Groups" g ON g."Id" = m."OwnerGroupId"- JOIN "AliasVaultUsers" u ON u."Id" = b."OwnerUserId"- WHERE g."Type" = 1 OR u."PersonalGroupId" = m."OwnerGroupId"- ORDER BY r."ManifestId", b."Hash", (u."PersonalGroupId" = m."OwnerGroupId") DESC, b."CreatedAt";- """);-- // The user-keyed originals go, and with them any blob no revision references: those are what the sweeper- // deletes anyway, and a client that still wants one is told it is missing and uploads it again.- migrationBuilder.Sql("""DELETE FROM "VaultBlobObjects" WHERE "ManifestId" IS NULL;""");-- migrationBuilder.DropColumn(- name: "OwnerUserId",- table: "VaultBlobObjects");-- migrationBuilder.AlterColumn<Guid>(- name: "ManifestId",- table: "VaultBlobObjects",- type: "uuid",- nullable: false,- oldClrType: typeof(Guid),- oldType: "uuid",- oldNullable: true);-- migrationBuilder.AddPrimaryKey(- name: "PK_VaultBlobObjects",- table: "VaultBlobObjects",- columns: new[] { "ManifestId", "Hash" });-- migrationBuilder.AddForeignKey(- name: "FK_VaultBlobObjects_VaultManifests_ManifestId",- table: "VaultBlobObjects",- column: "ManifestId",- principalTable: "VaultManifests",- principalColumn: "ManifestId",- onDelete: ReferentialAction.Cascade);- }-- /// <inheritdoc />- protected override void Down(MigrationBuilder migrationBuilder)- {- migrationBuilder.DropForeignKey(- name: "FK_VaultBlobObjects_VaultManifests_ManifestId",- table: "VaultBlobObjects");-- migrationBuilder.DropPrimaryKey(- name: "PK_VaultBlobObjects",- table: "VaultBlobObjects");-- migrationBuilder.AddColumn<string>(- name: "OwnerUserId",- table: "VaultBlobObjects",- type: "character varying(255)",- maxLength: 255,- nullable: true);-- // Each blob goes back to the earliest owner of the group that owns its manifest.- migrationBuilder.Sql("""- UPDATE "VaultBlobObjects" b SET "OwnerUserId" = (- SELECT gm."UserId" FROM "VaultManifests" m- JOIN "GroupMembers" gm ON gm."GroupId" = m."OwnerGroupId"- WHERE m."ManifestId" = b."ManifestId" AND gm."Role" = 0- ORDER BY gm."CreatedAt", gm."UserId" LIMIT 1);- DELETE FROM "VaultBlobObjects" WHERE "OwnerUserId" IS NULL;- DELETE FROM "VaultBlobObjects" a USING "VaultBlobObjects" b WHERE a."Hash" = b."Hash" AND a."OwnerUserId" = b."OwnerUserId" AND a."ManifestId" > b."ManifestId";- """);-- migrationBuilder.DropColumn(- name: "ManifestId",- table: "VaultBlobObjects");-- migrationBuilder.AlterColumn<string>(- name: "OwnerUserId",- table: "VaultBlobObjects",- type: "character varying(255)",- maxLength: 255,- nullable: false,- oldClrType: typeof(string),- oldType: "character varying(255)",- oldMaxLength: 255,- oldNullable: true);-- migrationBuilder.AddPrimaryKey(- name: "PK_VaultBlobObjects",- table: "VaultBlobObjects",- columns: new[] { "Hash", "OwnerUserId" });-- migrationBuilder.CreateIndex(- name: "IX_VaultBlobObjects_OwnerUserId_Category",- table: "VaultBlobObjects",- columns: new[] { "OwnerUserId", "Category" });-- migrationBuilder.AddForeignKey(- name: "FK_VaultBlobObjects_AliasVaultUsers_OwnerUserId",- table: "VaultBlobObjects",- column: "OwnerUserId",- principalTable: "AliasVaultUsers",- principalColumn: "Id",- onDelete: ReferentialAction.Cascade);- }- }-}