Skip to content

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

Squash server EF migrations (#2469)

Leendert de Borst5fba82f956a1
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.cs
index a5dfbe2dc..d41aedb28 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.cs
@@ -476,39 +476,27 @@ namespace AliasServerDb.Migrations
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
+ b.Property<string>("State")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)");
+
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
+ b.Property<Guid?>("VaultManifestId")
+ .HasColumnType("uuid");
+
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.HasIndex("VaultManifestId", "CreatedAt");
- b.HasKey("EmailClaimId", "VaultManifestId");
+ b.HasIndex("VaultManifestId", "State");
- b.HasIndex("EmailClaimId")
- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")
- .HasFilter("\"State\" <> 'Removed'");
-
- b.HasIndex("VaultManifestId", "EmailClaimId");
-
- b.ToTable("EmailClaimLinks");
+ b.ToTable("EmailClaims");
});
modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
@@ -881,8 +869,8 @@ namespace AliasServerDb.Migrations
b.Property<string>("EncryptedPrivateKey")
.IsRequired()
- .HasMaxLength(4000)
- .HasColumnType("character varying(4000)");
+ .HasMaxLength(8000)
+ .HasColumnType("character varying(8000)");
b.Property<bool>("IsPrimary")
.HasColumnType("boolean");
@@ -892,6 +880,11 @@ namespace AliasServerDb.Migrations
.HasMaxLength(2000)
.HasColumnType("character varying(2000)");
+ b.Property<string>("PublicKeySignature")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
@@ -910,6 +903,54 @@ namespace AliasServerDb.Migrations
b.ToTable("UserGrantKeys");
});
+ modelBuilder.Entity("AliasServerDb.UserSigningKey", 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(255)
+ .HasColumnType("character varying(255)");
+
+ b.Property<bool>("IsPrimary")
+ .HasColumnType("boolean");
+
+ b.Property<string>("PublicKey")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ 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_UserSigningKeys_User_Primary")
+ .HasFilter("\"IsPrimary\"");
+
+ b.ToTable("UserSigningKeys");
+ });
+
modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
{
b.Property<Guid>("Id")
@@ -1250,6 +1291,18 @@ namespace AliasServerDb.Migrations
.IsRequired()
.HasColumnType("text");
+ b.Property<string>("GrantSignature")
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
+ b.Property<string>("GrantSignerPublicKey")
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ b.Property<string>("GrantSignerUserId")
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
b.Property<int>("KeyVersion")
.HasColumnType("integer");
@@ -1525,21 +1578,12 @@ namespace AliasServerDb.Migrations
b.Navigation("Email");
});
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
+ modelBuilder.Entity("AliasServerDb.EmailClaim", 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");
+ .OnDelete(DeleteBehavior.SetNull);
b.Navigation("VaultManifest");
});
@@ -1625,6 +1669,17 @@ namespace AliasServerDb.Migrations
b.Navigation("User");
});
+ modelBuilder.Entity("AliasServerDb.UserSigningKey", 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")
@@ -1770,11 +1825,6 @@ namespace AliasServerDb.Migrations
b.Navigation("Parts");
});
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Navigation("Links");
- });
-
modelBuilder.Entity("AliasServerDb.Group", b =>
{
b.Navigation("Members");
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.cs
index 5375e0e11..ebcad35e3 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.cs
@@ -18,7 +18,7 @@ namespace AliasServerDb.Migrations
CreateUserMigrationMap(migrationBuilder);
IntroduceGroups(migrationBuilder);
ConvertVaultsToManifests(migrationBuilder);
- LinkEmailClaimsToManifests(migrationBuilder);
+ MoveEmailClaimsToManifests(migrationBuilder);
ScopeDeliveryKeysToManifests(migrationBuilder);
ScopeRateLimitsToGroups(migrationBuilder);
AddAlgorithmToMobileLoginRequests(migrationBuilder);
@@ -27,15 +27,17 @@ namespace AliasServerDb.Migrations
AddManifestV1Tables(migrationBuilder);
SkipToastCompressionOnCiphertextColumns(migrationBuilder);
AddForeignKeys(migrationBuilder);
+ AddOrphanedEmailClaimTrigger(migrationBuilder);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
+ DropOrphanedEmailClaimTrigger(migrationBuilder);
RemoveAnonymizedSenderCounts(migrationBuilder);
DropDetachedMessageParts(migrationBuilder);
RestoreMessageSourceText(migrationBuilder);
- RestoreSingleManifestLinks(migrationBuilder);
+ RestoreDisabledEmailClaims(migrationBuilder);
DropManifestV1Tables(migrationBuilder);
RestoreRateLimitsToUsers(migrationBuilder);
RemoveAlgorithmFromPublicKeys(migrationBuilder);
@@ -244,7 +246,7 @@ namespace AliasServerDb.Migrations
migrationBuilder.CreateIndex(name: "IX_VaultManifestsHistory_UpdatedByUserId", table: "VaultManifestsHistory", column: "UpdatedByUserId");
}
- private static void LinkEmailClaimsToManifests(MigrationBuilder migrationBuilder)
+ private static void MoveEmailClaimsToManifests(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "EmailClaims",
@@ -254,39 +256,29 @@ namespace AliasServerDb.Migrations
Address = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
AddressLocal = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
AddressDomain = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
+ VaultManifestId = table.Column<Guid>(type: "uuid", nullable: true),
+ State = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
AnonymizedSenderCounted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
});
- migrationBuilder.CreateTable(
- name: "EmailClaimLinks",
- columns: table => new
- {
- EmailClaimId = table.Column<Guid>(type: "uuid", nullable: false),
- VaultManifestId = table.Column<Guid>(type: "uuid", nullable: false),
- State = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false)
- });
-
+ // A claim of a user without a vault has no manifest to belong to and becomes a tombstone.
migrationBuilder.Sql("""
- INSERT INTO "EmailClaims" ("Id", "Address", "AddressLocal", "AddressDomain", "CreatedAt", "UpdatedAt")
- SELECT "Id", "Address", "AddressLocal", "AddressDomain", "CreatedAt", "UpdatedAt"
- FROM "UserEmailClaims";
-
- INSERT INTO "EmailClaimLinks" ("EmailClaimId", "VaultManifestId", "State")
- SELECT c."Id", m."ManifestId", CASE WHEN c."Disabled" THEN 'Removed' ELSE 'Active' END
+ INSERT INTO "EmailClaims" ("Id", "Address", "AddressLocal", "AddressDomain", "VaultManifestId", "State", "CreatedAt", "UpdatedAt")
+ SELECT c."Id", c."Address", c."AddressLocal", c."AddressDomain", m."ManifestId",
+ CASE WHEN c."Disabled" OR m."ManifestId" IS NULL THEN 'Removed' ELSE 'Active' END,
+ c."CreatedAt", c."UpdatedAt"
FROM "UserEmailClaims" c
- JOIN "UserMigrationMap" m ON m."UserId" = c."UserId"
- WHERE m."ManifestId" IS NOT NULL;
+ LEFT JOIN "UserMigrationMap" m ON m."UserId" = c."UserId";
""");
migrationBuilder.DropTable(name: "UserEmailClaims");
migrationBuilder.AddPrimaryKey(name: "PK_EmailClaims", table: "EmailClaims", column: "Id");
- migrationBuilder.AddPrimaryKey(name: "PK_EmailClaimLinks", table: "EmailClaimLinks", columns: new[] { "EmailClaimId", "VaultManifestId" });
migrationBuilder.CreateIndex(name: "IX_EmailClaims_Address", table: "EmailClaims", column: "Address", unique: true);
- migrationBuilder.CreateIndex(name: "IX_EmailClaimLinks_VaultManifestId_EmailClaimId", table: "EmailClaimLinks", columns: new[] { "VaultManifestId", "EmailClaimId" });
- migrationBuilder.Sql("""CREATE INDEX "IX_EmailClaimLinks_EmailClaimId_Live" ON "EmailClaimLinks" ("EmailClaimId") WHERE "State" <> 'Removed';""");
+ migrationBuilder.CreateIndex(name: "IX_EmailClaims_VaultManifestId_CreatedAt", table: "EmailClaims", columns: new[] { "VaultManifestId", "CreatedAt" });
+ migrationBuilder.CreateIndex(name: "IX_EmailClaims_VaultManifestId_State", table: "EmailClaims", columns: new[] { "VaultManifestId", "State" });
}
private static void ScopeDeliveryKeysToManifests(MigrationBuilder migrationBuilder)
@@ -445,7 +437,8 @@ namespace AliasServerDb.Migrations
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),
+ PublicKeySignature = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
+ EncryptedPrivateKey = table.Column<string>(type: "character varying(8000)", maxLength: 8000, nullable: false),
AccountKeyVersion = table.Column<int>(type: "integer", nullable: false, defaultValue: 0),
IsPrimary = table.Column<bool>(type: "boolean", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
@@ -462,6 +455,31 @@ namespace AliasServerDb.Migrations
onDelete: ReferentialAction.Cascade);
});
+ migrationBuilder.CreateTable(
+ name: "UserSigningKeys",
+ columns: table => new
+ {
+ 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(100)", maxLength: 100, nullable: false),
+ EncryptedPrivateKey = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
+ AccountKeyVersion = table.Column<int>(type: "integer", nullable: false),
+ IsPrimary = table.Column<bool>(type: "boolean", nullable: false),
+ CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
+ UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_UserSigningKeys", x => x.Id);
+ table.ForeignKey(
+ name: "FK_UserSigningKeys_AliasVaultUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AliasVaultUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
migrationBuilder.CreateTable(
name: "UserUnlockKeys",
columns: table => new
@@ -531,6 +549,9 @@ namespace AliasServerDb.Migrations
KeyVersion = table.Column<int>(type: "integer", nullable: false, defaultValue: 0),
UserGrantKeyId = table.Column<Guid>(type: "uuid", nullable: true),
AccountKeyVersion = table.Column<int>(type: "integer", nullable: true),
+ GrantSignature = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
+ GrantSignerUserId = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
+ GrantSignerPublicKey = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
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),
@@ -645,6 +666,7 @@ namespace AliasServerDb.Migrations
});
migrationBuilder.CreateIndex(name: "UX_UserGrantKeys_User_Primary", table: "UserGrantKeys", column: "UserId", unique: true, filter: "\"IsPrimary\"");
+ migrationBuilder.CreateIndex(name: "UX_UserSigningKeys_User_Primary", table: "UserSigningKeys", 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" });
@@ -675,14 +697,42 @@ namespace AliasServerDb.Migrations
migrationBuilder.AddForeignKey(name: "FK_VaultManifests_AliasVaultUsers_UpdatedByUserId", table: "VaultManifests", column: "UpdatedByUserId", principalTable: "AliasVaultUsers", principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey(name: "FK_VaultManifestsHistory_VaultManifests_ManifestId", table: "VaultManifestsHistory", column: "ManifestId", principalTable: "VaultManifests", principalColumn: "ManifestId", onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(name: "FK_VaultManifestsHistory_AliasVaultUsers_UpdatedByUserId", table: "VaultManifestsHistory", column: "UpdatedByUserId", principalTable: "AliasVaultUsers", principalColumn: "Id", onDelete: ReferentialAction.SetNull);
- migrationBuilder.AddForeignKey(name: "FK_EmailClaimLinks_EmailClaims_EmailClaimId", table: "EmailClaimLinks", column: "EmailClaimId", principalTable: "EmailClaims", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
- migrationBuilder.AddForeignKey(name: "FK_EmailClaimLinks_VaultManifests_VaultManifestId", table: "EmailClaimLinks", column: "VaultManifestId", principalTable: "VaultManifests", principalColumn: "ManifestId", onDelete: ReferentialAction.Cascade);
+ migrationBuilder.AddForeignKey(name: "FK_EmailClaims_VaultManifests_VaultManifestId", table: "EmailClaims", column: "VaultManifestId", principalTable: "VaultManifests", principalColumn: "ManifestId", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey(name: "FK_VaultManifestDeliveryKeys_VaultManifests_VaultManifestId", table: "VaultManifestDeliveryKeys", column: "VaultManifestId", principalTable: "VaultManifests", principalColumn: "ManifestId", onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(name: "FK_EmailDecryptionKeys_Emails_EmailId", table: "EmailDecryptionKeys", column: "EmailId", principalTable: "Emails", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(name: "FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId", table: "EmailDecryptionKeys", column: "VaultManifestDeliveryKeyId", principalTable: "VaultManifestDeliveryKeys", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(name: "FK_RateLimits_Groups_GroupId", table: "RateLimits", column: "GroupId", principalTable: "Groups", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
}
+ private static void AddOrphanedEmailClaimTrigger(MigrationBuilder migrationBuilder)
+ {
+ /*
+ * A claim loses its owner through ON DELETE SET NULL, which runs inside Postgres for every way a manifest
+ * goes (account, group or manifest delete, admin tools, raw SQL).
+ */
+ migrationBuilder.Sql("""
+ CREATE FUNCTION "EmailClaims_RemoveOrphaned"() RETURNS trigger AS $$
+ BEGIN
+ NEW."State" := 'Removed';
+ RETURN NEW;
+ END;
+ $$ LANGUAGE plpgsql;
+
+ CREATE TRIGGER "TR_EmailClaims_RemoveOrphaned"
+ BEFORE INSERT OR UPDATE OF "VaultManifestId", "State" ON "EmailClaims"
+ FOR EACH ROW WHEN (NEW."VaultManifestId" IS NULL AND NEW."State" <> 'Removed')
+ EXECUTE FUNCTION "EmailClaims_RemoveOrphaned"();
+ """);
+ }
+
+ private static void DropOrphanedEmailClaimTrigger(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.Sql("""
+ DROP TRIGGER "TR_EmailClaims_RemoveOrphaned" ON "EmailClaims";
+ DROP FUNCTION "EmailClaims_RemoveOrphaned"();
+ """);
+ }
+
private static void RemoveAnonymizedSenderCounts(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(name: "AnonymizedEmailAliasSenderCounts", table: "Groups");
@@ -702,20 +752,15 @@ namespace AliasServerDb.Migrations
migrationBuilder.AlterColumn<string>(name: "MessageSource", table: "Emails", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true);
}
- private static void RestoreSingleManifestLinks(MigrationBuilder migrationBuilder)
+ private static void RestoreDisabledEmailClaims(MigrationBuilder migrationBuilder)
{
- migrationBuilder.Sql("""DROP INDEX IF EXISTS "IX_EmailClaimLinks_EmailClaimId_Live";""");
-
+ migrationBuilder.DropIndex(name: "IX_EmailClaims_VaultManifestId_State", table: "EmailClaims");
migrationBuilder.AddColumn<bool>(name: "Disabled", table: "EmailClaims", type: "boolean", nullable: false, defaultValue: false);
-
- migrationBuilder.Sql("""
- UPDATE "EmailClaims" c
- SET "Disabled" = NOT EXISTS (SELECT 1 FROM "EmailClaimLinks" l WHERE l."EmailClaimId" = c."Id" AND l."State" <> 'Removed');
- """);
+ migrationBuilder.Sql("""UPDATE "EmailClaims" SET "Disabled" = "State" = 'Removed';""");
+ migrationBuilder.DropColumn(name: "State", table: "EmailClaims");
migrationBuilder.AddColumn<string>(name: "EncryptedSymmetricKey", table: "Emails", type: "text", nullable: true);
migrationBuilder.AddColumn<Guid>(name: "EncryptionKeyId", table: "Emails", type: "uuid", maxLength: 255, nullable: true);
- migrationBuilder.AddColumn<Guid>(name: "VaultManifestId", table: "EmailClaims", type: "uuid", nullable: true);
// One key per row. Emails left with none are deleted.
migrationBuilder.Sql("""
@@ -725,24 +770,16 @@ namespace AliasServerDb.Migrations
WHERE d."EmailId" = e."Id";
DELETE FROM "Emails" WHERE "EncryptionKeyId" IS NULL;
-
- UPDATE "EmailClaims" c
- SET "VaultManifestId" = l."VaultManifestId"
- FROM (SELECT DISTINCT ON ("EmailClaimId") "EmailClaimId", "VaultManifestId" FROM "EmailClaimLinks" ORDER BY "EmailClaimId", "VaultManifestId") l
- WHERE l."EmailClaimId" = c."Id";
""");
migrationBuilder.AlterColumn<string>(name: "EncryptedSymmetricKey", table: "Emails", type: "text", nullable: false, oldClrType: typeof(string), oldType: "text", oldNullable: true);
migrationBuilder.AlterColumn<Guid>(name: "EncryptionKeyId", table: "Emails", type: "uuid", maxLength: 255, nullable: false, oldClrType: typeof(Guid), oldType: "uuid", oldMaxLength: 255, oldNullable: true);
- migrationBuilder.DropTable(name: "EmailClaimLinks");
migrationBuilder.DropTable(name: "EmailDecryptionKeys");
migrationBuilder.CreateIndex(name: "IX_Emails_EncryptionKeyId", table: "Emails", column: "EncryptionKeyId");
- migrationBuilder.CreateIndex(name: "IX_EmailClaims_VaultManifestId_CreatedAt", table: "EmailClaims", columns: new[] { "VaultManifestId", "CreatedAt" });
migrationBuilder.CreateIndex(name: "IX_EmailClaims_VaultManifestId_Disabled", table: "EmailClaims", columns: new[] { "VaultManifestId", "Disabled" });
- migrationBuilder.AddForeignKey(name: "FK_EmailClaims_VaultManifests_VaultManifestId", table: "EmailClaims", column: "VaultManifestId", principalTable: "VaultManifests", principalColumn: "ManifestId", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey(name: "FK_Emails_VaultManifestDeliveryKeys_EncryptionKeyId", table: "Emails", column: "EncryptionKeyId", principalTable: "VaultManifestDeliveryKeys", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
}
@@ -755,6 +792,7 @@ namespace AliasServerDb.Migrations
migrationBuilder.DropTable(name: "VaultManifestAccessKeys");
migrationBuilder.DropTable(name: "UserUnlockKeysHistory");
migrationBuilder.DropTable(name: "UserUnlockKeys");
+ migrationBuilder.DropTable(name: "UserSigningKeys");
migrationBuilder.DropTable(name: "UserGrantKeys");
}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs
index c9f3286b6..1c1f866cd 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs
@@ -587,39 +587,27 @@ namespace AliasServerDb.Migrations
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
+ b.Property<string>("State")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)");
+
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
+ b.Property<Guid?>("VaultManifestId")
+ .HasColumnType("uuid");
+
b.HasKey("Id");
b.HasIndex("Address")
.IsUnique();
- b.ToTable("EmailClaims");
- });
+ b.HasIndex("VaultManifestId", "CreatedAt");
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.Property<Guid>("EmailClaimId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
+ b.HasIndex("VaultManifestId", "State");
- 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");
+ b.ToTable("EmailClaims");
});
modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
@@ -732,9 +720,21 @@ namespace AliasServerDb.Migrations
b.Property<string>("EncryptedName")
.HasColumnType("text");
+ b.Property<string>("EncryptedNameSignature")
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
b.Property<string>("EncryptedVek")
.HasColumnType("text");
+ b.Property<string>("GrantSignature")
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
+ b.Property<string>("GrantSignerPublicKey")
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
b.Property<Guid>("GroupId")
.HasColumnType("uuid");
@@ -1068,8 +1068,8 @@ namespace AliasServerDb.Migrations
b.Property<string>("EncryptedPrivateKey")
.IsRequired()
- .HasMaxLength(4000)
- .HasColumnType("character varying(4000)");
+ .HasMaxLength(8000)
+ .HasColumnType("character varying(8000)");
b.Property<bool>("IsPrimary")
.HasColumnType("boolean");
@@ -1079,6 +1079,11 @@ namespace AliasServerDb.Migrations
.HasMaxLength(2000)
.HasColumnType("character varying(2000)");
+ b.Property<string>("PublicKeySignature")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
@@ -1097,6 +1102,54 @@ namespace AliasServerDb.Migrations
b.ToTable("UserGrantKeys");
});
+ modelBuilder.Entity("AliasServerDb.UserSigningKey", 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(255)
+ .HasColumnType("character varying(255)");
+
+ b.Property<bool>("IsPrimary")
+ .HasColumnType("boolean");
+
+ b.Property<string>("PublicKey")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ 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_UserSigningKeys_User_Primary")
+ .HasFilter("\"IsPrimary\"");
+
+ b.ToTable("UserSigningKeys");
+ });
+
modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
{
b.Property<Guid>("Id")
@@ -1437,6 +1490,18 @@ namespace AliasServerDb.Migrations
.IsRequired()
.HasColumnType("text");
+ b.Property<string>("GrantSignature")
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
+ b.Property<string>("GrantSignerPublicKey")
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ b.Property<string>("GrantSignerUserId")
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
b.Property<int>("KeyVersion")
.HasColumnType("integer");
@@ -1766,21 +1831,12 @@ namespace AliasServerDb.Migrations
b.Navigation("Email");
});
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
+ modelBuilder.Entity("AliasServerDb.EmailClaim", 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");
+ .OnDelete(DeleteBehavior.SetNull);
b.Navigation("VaultManifest");
});
@@ -1900,6 +1956,17 @@ namespace AliasServerDb.Migrations
b.Navigation("User");
});
+ modelBuilder.Entity("AliasServerDb.UserSigningKey", 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")
@@ -2056,11 +2123,6 @@ namespace AliasServerDb.Migrations
b.Navigation("Parts");
});
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Navigation("Links");
- });
-
modelBuilder.Entity("AliasServerDb.Group", b =>
{
b.Navigation("Members");
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.cs b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.cs
index a4a893744..052538855 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.cs
@@ -55,9 +55,12 @@ namespace AliasServerDb.Migrations
Role = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
VaultManifestId = table.Column<Guid>(type: "uuid", nullable: true),
EncryptedName = table.Column<string>(type: "text", nullable: true),
+ EncryptedNameSignature = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
EncryptedVek = table.Column<string>(type: "text", nullable: true),
VaultKeyVersion = table.Column<int>(type: "integer", nullable: false, defaultValue: 0),
UserGrantKeyId = table.Column<Guid>(type: "uuid", nullable: true),
+ GrantSignature = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
+ GrantSignerPublicKey = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
Algorithm = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
State = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.Designer.cs
index b91003708..3749e1b35 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.Designer.cs
@@ -587,39 +587,27 @@ namespace AliasServerDb.Migrations
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
+ b.Property<string>("State")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)");
+
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
+ b.Property<Guid?>("VaultManifestId")
+ .HasColumnType("uuid");
+
b.HasKey("Id");
b.HasIndex("Address")
.IsUnique();
- b.ToTable("EmailClaims");
- });
+ b.HasIndex("VaultManifestId", "CreatedAt");
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.Property<Guid>("EmailClaimId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
+ b.HasIndex("VaultManifestId", "State");
- 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");
+ b.ToTable("EmailClaims");
});
modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
@@ -732,9 +720,21 @@ namespace AliasServerDb.Migrations
b.Property<string>("EncryptedName")
.HasColumnType("text");
+ b.Property<string>("EncryptedNameSignature")
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
b.Property<string>("EncryptedVek")
.HasColumnType("text");
+ b.Property<string>("GrantSignature")
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
+ b.Property<string>("GrantSignerPublicKey")
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
b.Property<Guid>("GroupId")
.HasColumnType("uuid");
@@ -920,7 +920,7 @@ namespace AliasServerDb.Migrations
b.Property<DateTime?>("DeclinedAt")
.HasColumnType("timestamp with time zone");
- b.Property<string>("EncryptedUnlockKey")
+ b.Property<string>("EncryptedAccountKey")
.HasColumnType("text");
b.Property<DateTime?>("FulfilledAt")
@@ -1088,8 +1088,8 @@ namespace AliasServerDb.Migrations
b.Property<string>("EncryptedPrivateKey")
.IsRequired()
- .HasMaxLength(4000)
- .HasColumnType("character varying(4000)");
+ .HasMaxLength(8000)
+ .HasColumnType("character varying(8000)");
b.Property<bool>("IsPrimary")
.HasColumnType("boolean");
@@ -1099,6 +1099,11 @@ namespace AliasServerDb.Migrations
.HasMaxLength(2000)
.HasColumnType("character varying(2000)");
+ b.Property<string>("PublicKeySignature")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
@@ -1117,6 +1122,54 @@ namespace AliasServerDb.Migrations
b.ToTable("UserGrantKeys");
});
+ modelBuilder.Entity("AliasServerDb.UserSigningKey", 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(255)
+ .HasColumnType("character varying(255)");
+
+ b.Property<bool>("IsPrimary")
+ .HasColumnType("boolean");
+
+ b.Property<string>("PublicKey")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ 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_UserSigningKeys_User_Primary")
+ .HasFilter("\"IsPrimary\"");
+
+ b.ToTable("UserSigningKeys");
+ });
+
modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
{
b.Property<Guid>("Id")
@@ -1457,6 +1510,18 @@ namespace AliasServerDb.Migrations
.IsRequired()
.HasColumnType("text");
+ b.Property<string>("GrantSignature")
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
+ b.Property<string>("GrantSignerPublicKey")
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ b.Property<string>("GrantSignerUserId")
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
b.Property<int>("KeyVersion")
.HasColumnType("integer");
@@ -1786,21 +1851,12 @@ namespace AliasServerDb.Migrations
b.Navigation("Email");
});
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
+ modelBuilder.Entity("AliasServerDb.EmailClaim", 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");
+ .OnDelete(DeleteBehavior.SetNull);
b.Navigation("VaultManifest");
});
@@ -1920,6 +1976,17 @@ namespace AliasServerDb.Migrations
b.Navigation("User");
});
+ modelBuilder.Entity("AliasServerDb.UserSigningKey", 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")
@@ -2076,11 +2143,6 @@ namespace AliasServerDb.Migrations
b.Navigation("Parts");
});
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Navigation("Links");
- });
-
modelBuilder.Entity("AliasServerDb.Group", b =>
{
b.Navigation("Members");
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.cs b/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.cs
index 0af00e1b8..4667769d0 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.cs
@@ -14,7 +14,7 @@ namespace AliasServerDb.Migrations
migrationBuilder.RenameColumn(
name: "EncryptedDecryptionKey",
table: "MobileLoginRequests",
- newName: "EncryptedUnlockKey");
+ newName: "EncryptedAccountKey");
migrationBuilder.AddColumn<string>(
name: "ClientBrowser",
@@ -76,7 +76,7 @@ namespace AliasServerDb.Migrations
table: "MobileLoginRequests");
migrationBuilder.RenameColumn(
- name: "EncryptedUnlockKey",
+ name: "EncryptedAccountKey",
table: "MobileLoginRequests",
newName: "EncryptedDecryptionKey");
}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20261001200310_AddRegistrationInvites.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20261001200310_AddRegistrationInvites.Designer.cs
index 1df36df77..f6acf662b 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20261001200310_AddRegistrationInvites.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20261001200310_AddRegistrationInvites.Designer.cs
@@ -587,39 +587,27 @@ namespace AliasServerDb.Migrations
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
+ b.Property<string>("State")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)");
+
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
+ b.Property<Guid?>("VaultManifestId")
+ .HasColumnType("uuid");
+
b.HasKey("Id");
b.HasIndex("Address")
.IsUnique();
- b.ToTable("EmailClaims");
- });
+ b.HasIndex("VaultManifestId", "CreatedAt");
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.Property<Guid>("EmailClaimId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
+ b.HasIndex("VaultManifestId", "State");
- 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");
+ b.ToTable("EmailClaims");
});
modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
@@ -732,9 +720,21 @@ namespace AliasServerDb.Migrations
b.Property<string>("EncryptedName")
.HasColumnType("text");
+ b.Property<string>("EncryptedNameSignature")
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
b.Property<string>("EncryptedVek")
.HasColumnType("text");
+ b.Property<string>("GrantSignature")
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
+ b.Property<string>("GrantSignerPublicKey")
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
b.Property<Guid>("GroupId")
.HasColumnType("uuid");
@@ -920,7 +920,7 @@ namespace AliasServerDb.Migrations
b.Property<DateTime?>("DeclinedAt")
.HasColumnType("timestamp with time zone");
- b.Property<string>("EncryptedUnlockKey")
+ b.Property<string>("EncryptedAccountKey")
.HasColumnType("text");
b.Property<DateTime?>("FulfilledAt")
@@ -1130,8 +1130,8 @@ namespace AliasServerDb.Migrations
b.Property<string>("EncryptedPrivateKey")
.IsRequired()
- .HasMaxLength(4000)
- .HasColumnType("character varying(4000)");
+ .HasMaxLength(8000)
+ .HasColumnType("character varying(8000)");
b.Property<bool>("IsPrimary")
.HasColumnType("boolean");
@@ -1141,6 +1141,11 @@ namespace AliasServerDb.Migrations
.HasMaxLength(2000)
.HasColumnType("character varying(2000)");
+ b.Property<string>("PublicKeySignature")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
@@ -1159,6 +1164,54 @@ namespace AliasServerDb.Migrations
b.ToTable("UserGrantKeys");
});
+ modelBuilder.Entity("AliasServerDb.UserSigningKey", 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(255)
+ .HasColumnType("character varying(255)");
+
+ b.Property<bool>("IsPrimary")
+ .HasColumnType("boolean");
+
+ b.Property<string>("PublicKey")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ 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_UserSigningKeys_User_Primary")
+ .HasFilter("\"IsPrimary\"");
+
+ b.ToTable("UserSigningKeys");
+ });
+
modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
{
b.Property<Guid>("Id")
@@ -1499,6 +1552,18 @@ namespace AliasServerDb.Migrations
.IsRequired()
.HasColumnType("text");
+ b.Property<string>("GrantSignature")
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
+ b.Property<string>("GrantSignerPublicKey")
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ b.Property<string>("GrantSignerUserId")
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
b.Property<int>("KeyVersion")
.HasColumnType("integer");
@@ -1828,21 +1893,12 @@ namespace AliasServerDb.Migrations
b.Navigation("Email");
});
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
+ modelBuilder.Entity("AliasServerDb.EmailClaim", 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");
+ .OnDelete(DeleteBehavior.SetNull);
b.Navigation("VaultManifest");
});
@@ -1962,6 +2018,17 @@ namespace AliasServerDb.Migrations
b.Navigation("User");
});
+ modelBuilder.Entity("AliasServerDb.UserSigningKey", 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")
@@ -2118,11 +2185,6 @@ namespace AliasServerDb.Migrations
b.Navigation("Parts");
});
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Navigation("Links");
- });
-
modelBuilder.Entity("AliasServerDb.Group", b =>
{
b.Navigation("Members");
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20261004181927_SingleOwnerEmailClaims.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20261004181927_SingleOwnerEmailClaims.Designer.cs
deleted file mode 100644
index 110f440eb..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20261004181927_SingleOwnerEmailClaims.Designer.cs
+++ /dev/null
@@ -1,2112 +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("20261004181927_SingleOwnerEmailClaims")]
- partial class SingleOwnerEmailClaims
- {
- /// <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<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("VaultManifestId", "CreatedAt");
-
- b.HasIndex("VaultManifestId", "State");
-
- b.ToTable("EmailClaims");
- });
-
- 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<string>("Type")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- 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<string>("Role")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- 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<string>("Role")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- 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>("ClientBrowser")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("ClientName")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientOperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientPublicKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("DeclinedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedUnlockKey")
- .HasColumnType("text");
-
- b.Property<DateTime?>("FulfilledAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("MobileIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("PollSecretHash")
- .IsRequired()
- .HasMaxLength(44)
- .HasColumnType("character varying(44)");
-
- 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.RegistrationInvite", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Code")
- .IsRequired()
- .HasMaxLength(32)
- .HasColumnType("character varying(32)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("ExpiresAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("MaxUses")
- .HasColumnType("integer");
-
- b.Property<string>("Note")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<int>("UseCount")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "Code" }, "IX_RegistrationInvite_Code")
- .IsUnique();
-
- b.ToTable("RegistrationInvites");
- });
-
- 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<string>("EncryptedBlobKey")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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>("UpdatedByUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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.HasIndex("UpdatedByUserId");
-
- 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.VaultManifestShareDetails", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedName")
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId");
-
- b.ToTable("VaultManifestShareDetails");
- });
-
- 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>("UpdatedByUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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.HasIndex("UpdatedByUserId");
-
- 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.EmailClaim", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.SetNull);
-
- 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.HasOne("AliasServerDb.AliasVaultUser", "UpdatedByUser")
- .WithMany()
- .HasForeignKey("UpdatedByUserId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("OwnerGroup");
-
- b.Navigation("UpdatedByUser");
- });
-
- 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.VaultManifestShareDetails", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithOne()
- .HasForeignKey("AliasServerDb.VaultManifestShareDetails", "ManifestId")
- .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.HasOne("AliasServerDb.AliasVaultUser", "UpdatedByUser")
- .WithMany()
- .HasForeignKey("UpdatedByUserId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("Manifest");
-
- b.Navigation("UpdatedByUser");
- });
-
- 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.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/20261004181927_SingleOwnerEmailClaims.cs b/apps/server/Databases/AliasServerDb/Migrations/20261004181927_SingleOwnerEmailClaims.cs
deleted file mode 100644
index e0d4fe02f..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20261004181927_SingleOwnerEmailClaims.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations
-{
- /// <inheritdoc />
- public partial class SingleOwnerEmailClaims : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<string>(name: "State", table: "EmailClaims", type: "character varying(20)", maxLength: 20, nullable: false, defaultValue: "Active");
- migrationBuilder.AddColumn<Guid>(name: "VaultManifestId", table: "EmailClaims", type: "uuid", nullable: true);
-
- // Every claim keeps one owner: its live link when it has one, else any link. Claims without links stay tombstones.
- migrationBuilder.Sql("""
- UPDATE "EmailClaims" c
- SET "VaultManifestId" = l."VaultManifestId", "State" = l."State"
- FROM (
- SELECT DISTINCT ON ("EmailClaimId") "EmailClaimId", "VaultManifestId", "State"
- FROM "EmailClaimLinks"
- ORDER BY "EmailClaimId", ("State" = 'Removed'), "VaultManifestId"
- ) l
- WHERE l."EmailClaimId" = c."Id";
- """);
- migrationBuilder.Sql("""UPDATE "EmailClaims" SET "State" = 'Removed' WHERE "VaultManifestId" IS NULL;""");
-
- migrationBuilder.DropTable(name: "EmailClaimLinks");
-
- migrationBuilder.CreateIndex(name: "IX_EmailClaims_VaultManifestId_CreatedAt", table: "EmailClaims", columns: new[] { "VaultManifestId", "CreatedAt" });
- migrationBuilder.CreateIndex(name: "IX_EmailClaims_VaultManifestId_State", table: "EmailClaims", columns: new[] { "VaultManifestId", "State" });
- migrationBuilder.AddForeignKey(name: "FK_EmailClaims_VaultManifests_VaultManifestId", table: "EmailClaims", column: "VaultManifestId", principalTable: "VaultManifests", principalColumn: "ManifestId", onDelete: ReferentialAction.SetNull);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(name: "FK_EmailClaims_VaultManifests_VaultManifestId", table: "EmailClaims");
- migrationBuilder.DropIndex(name: "IX_EmailClaims_VaultManifestId_CreatedAt", table: "EmailClaims");
- migrationBuilder.DropIndex(name: "IX_EmailClaims_VaultManifestId_State", table: "EmailClaims");
-
- migrationBuilder.CreateTable(
- name: "EmailClaimLinks",
- columns: table => new
- {
- EmailClaimId = table.Column<Guid>(type: "uuid", nullable: false),
- VaultManifestId = table.Column<Guid>(type: "uuid", nullable: false),
- State = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_EmailClaimLinks", x => new { x.EmailClaimId, x.VaultManifestId });
- table.ForeignKey(name: "FK_EmailClaimLinks_EmailClaims_EmailClaimId", column: x => x.EmailClaimId, principalTable: "EmailClaims", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
- table.ForeignKey(name: "FK_EmailClaimLinks_VaultManifests_VaultManifestId", column: x => x.VaultManifestId, principalTable: "VaultManifests", principalColumn: "ManifestId", onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.Sql("""
- INSERT INTO "EmailClaimLinks" ("EmailClaimId", "VaultManifestId", "State")
- SELECT "Id", "VaultManifestId", "State" FROM "EmailClaims" WHERE "VaultManifestId" IS NOT NULL;
- """);
-
- migrationBuilder.CreateIndex(name: "IX_EmailClaimLinks_EmailClaimId_Live", table: "EmailClaimLinks", column: "EmailClaimId", filter: "\"State\" <> 'Removed'");
- migrationBuilder.CreateIndex(name: "IX_EmailClaimLinks_VaultManifestId_EmailClaimId", table: "EmailClaimLinks", columns: new[] { "VaultManifestId", "EmailClaimId" });
-
- migrationBuilder.DropColumn(name: "State", table: "EmailClaims");
- migrationBuilder.DropColumn(name: "VaultManifestId", table: "EmailClaims");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20261004210216_RenameMobileLoginEncryptedAccountKey.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20261004210216_RenameMobileLoginEncryptedAccountKey.Designer.cs
deleted file mode 100644
index 984012748..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20261004210216_RenameMobileLoginEncryptedAccountKey.Designer.cs
+++ /dev/null
@@ -1,2112 +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("20261004210216_RenameMobileLoginEncryptedAccountKey")]
- partial class RenameMobileLoginEncryptedAccountKey
- {
- /// <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<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("VaultManifestId", "CreatedAt");
-
- b.HasIndex("VaultManifestId", "State");
-
- b.ToTable("EmailClaims");
- });
-
- 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<string>("Type")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- 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<string>("Role")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- 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<string>("Role")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- 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>("ClientBrowser")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("ClientName")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientOperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientPublicKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("DeclinedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedAccountKey")
- .HasColumnType("text");
-
- b.Property<DateTime?>("FulfilledAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("MobileIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("PollSecretHash")
- .IsRequired()
- .HasMaxLength(44)
- .HasColumnType("character varying(44)");
-
- 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.RegistrationInvite", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Code")
- .IsRequired()
- .HasMaxLength(32)
- .HasColumnType("character varying(32)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("ExpiresAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("MaxUses")
- .HasColumnType("integer");
-
- b.Property<string>("Note")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<int>("UseCount")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "Code" }, "IX_RegistrationInvite_Code")
- .IsUnique();
-
- b.ToTable("RegistrationInvites");
- });
-
- 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<string>("EncryptedBlobKey")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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>("UpdatedByUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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.HasIndex("UpdatedByUserId");
-
- 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.VaultManifestShareDetails", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedName")
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId");
-
- b.ToTable("VaultManifestShareDetails");
- });
-
- 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>("UpdatedByUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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.HasIndex("UpdatedByUserId");
-
- 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.EmailClaim", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.SetNull);
-
- 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.HasOne("AliasServerDb.AliasVaultUser", "UpdatedByUser")
- .WithMany()
- .HasForeignKey("UpdatedByUserId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("OwnerGroup");
-
- b.Navigation("UpdatedByUser");
- });
-
- 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.VaultManifestShareDetails", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithOne()
- .HasForeignKey("AliasServerDb.VaultManifestShareDetails", "ManifestId")
- .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.HasOne("AliasServerDb.AliasVaultUser", "UpdatedByUser")
- .WithMany()
- .HasForeignKey("UpdatedByUserId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("Manifest");
-
- b.Navigation("UpdatedByUser");
- });
-
- 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.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/20261004210216_RenameMobileLoginEncryptedAccountKey.cs b/apps/server/Databases/AliasServerDb/Migrations/20261004210216_RenameMobileLoginEncryptedAccountKey.cs
deleted file mode 100644
index 5beeeabdf..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20261004210216_RenameMobileLoginEncryptedAccountKey.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations
-{
- /// <inheritdoc />
- public partial class RenameMobileLoginEncryptedAccountKey : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.RenameColumn(
- name: "EncryptedUnlockKey",
- table: "MobileLoginRequests",
- newName: "EncryptedAccountKey");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.RenameColumn(
- name: "EncryptedAccountKey",
- table: "MobileLoginRequests",
- newName: "EncryptedUnlockKey");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20261004212219_RemoveOrphanedEmailClaims.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20261004212219_RemoveOrphanedEmailClaims.Designer.cs
deleted file mode 100644
index 4dac9c135..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20261004212219_RemoveOrphanedEmailClaims.Designer.cs
+++ /dev/null
@@ -1,2112 +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("20261004212219_RemoveOrphanedEmailClaims")]
- partial class RemoveOrphanedEmailClaims
- {
- /// <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<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("VaultManifestId", "CreatedAt");
-
- b.HasIndex("VaultManifestId", "State");
-
- b.ToTable("EmailClaims");
- });
-
- 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<string>("Type")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- 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<string>("Role")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- 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<string>("Role")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- 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>("ClientBrowser")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("ClientName")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientOperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientPublicKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("DeclinedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedAccountKey")
- .HasColumnType("text");
-
- b.Property<DateTime?>("FulfilledAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("MobileIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("PollSecretHash")
- .IsRequired()
- .HasMaxLength(44)
- .HasColumnType("character varying(44)");
-
- 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.RegistrationInvite", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Code")
- .IsRequired()
- .HasMaxLength(32)
- .HasColumnType("character varying(32)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("ExpiresAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("MaxUses")
- .HasColumnType("integer");
-
- b.Property<string>("Note")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<int>("UseCount")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "Code" }, "IX_RegistrationInvite_Code")
- .IsUnique();
-
- b.ToTable("RegistrationInvites");
- });
-
- 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<string>("EncryptedBlobKey")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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>("UpdatedByUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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.HasIndex("UpdatedByUserId");
-
- 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.VaultManifestShareDetails", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedName")
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId");
-
- b.ToTable("VaultManifestShareDetails");
- });
-
- 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>("UpdatedByUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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.HasIndex("UpdatedByUserId");
-
- 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.EmailClaim", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.SetNull);
-
- 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.HasOne("AliasServerDb.AliasVaultUser", "UpdatedByUser")
- .WithMany()
- .HasForeignKey("UpdatedByUserId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("OwnerGroup");
-
- b.Navigation("UpdatedByUser");
- });
-
- 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.VaultManifestShareDetails", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithOne()
- .HasForeignKey("AliasServerDb.VaultManifestShareDetails", "ManifestId")
- .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.HasOne("AliasServerDb.AliasVaultUser", "UpdatedByUser")
- .WithMany()
- .HasForeignKey("UpdatedByUserId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("Manifest");
-
- b.Navigation("UpdatedByUser");
- });
-
- 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.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/20261004212219_RemoveOrphanedEmailClaims.cs b/apps/server/Databases/AliasServerDb/Migrations/20261004212219_RemoveOrphanedEmailClaims.cs
deleted file mode 100644
index 469968db8..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20261004212219_RemoveOrphanedEmailClaims.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations
-{
- /// <inheritdoc />
- public partial class RemoveOrphanedEmailClaims : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- /*
- * A claim loses its owner through ON DELETE SET NULL, which runs inside Postgres for every way a manifest
- * goes (account, group or manifest delete, admin tools, raw SQL).
- */
- migrationBuilder.Sql("""
- CREATE FUNCTION "EmailClaims_RemoveOrphaned"() RETURNS trigger AS $$
- BEGIN
- NEW."State" := 'Removed';
- RETURN NEW;
- END;
- $$ LANGUAGE plpgsql;
-
- CREATE TRIGGER "TR_EmailClaims_RemoveOrphaned"
- BEFORE INSERT OR UPDATE OF "VaultManifestId", "State" ON "EmailClaims"
- FOR EACH ROW WHEN (NEW."VaultManifestId" IS NULL AND NEW."State" <> 'Removed')
- EXECUTE FUNCTION "EmailClaims_RemoveOrphaned"();
-
- UPDATE "EmailClaims" SET "State" = 'Removed' WHERE "VaultManifestId" IS NULL AND "State" <> 'Removed';
- """);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.Sql("""
- DROP TRIGGER "TR_EmailClaims_RemoveOrphaned" ON "EmailClaims";
- DROP FUNCTION "EmailClaims_RemoveOrphaned"();
- """);
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20261005080213_AddAccountSigningKeys.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20261005080213_AddAccountSigningKeys.Designer.cs
deleted file mode 100644
index cf136f2ca..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20261005080213_AddAccountSigningKeys.Designer.cs
+++ /dev/null
@@ -1,2200 +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("20261005080213_AddAccountSigningKeys")]
- partial class AddAccountSigningKeys
- {
- /// <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<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("VaultManifestId", "CreatedAt");
-
- b.HasIndex("VaultManifestId", "State");
-
- b.ToTable("EmailClaims");
- });
-
- 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<string>("Type")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- 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>("EncryptedNameSignature")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("EncryptedVek")
- .HasColumnType("text");
-
- b.Property<string>("GrantSignature")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("GrantSignerPublicKey")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- 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<string>("Role")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- 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<string>("Role")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- 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>("ClientBrowser")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("ClientName")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientOperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientPublicKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("DeclinedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedAccountKey")
- .HasColumnType("text");
-
- b.Property<DateTime?>("FulfilledAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("MobileIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("PollSecretHash")
- .IsRequired()
- .HasMaxLength(44)
- .HasColumnType("character varying(44)");
-
- 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.RegistrationInvite", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Code")
- .IsRequired()
- .HasMaxLength(32)
- .HasColumnType("character varying(32)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("ExpiresAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("MaxUses")
- .HasColumnType("integer");
-
- b.Property<string>("Note")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<int>("UseCount")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "Code" }, "IX_RegistrationInvite_Code")
- .IsUnique();
-
- b.ToTable("RegistrationInvites");
- });
-
- 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<string>("PublicKeySignature")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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.UserSigningKey", 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(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("boolean");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- 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_UserSigningKeys_User_Primary")
- .HasFilter("\"IsPrimary\"");
-
- b.ToTable("UserSigningKeys");
- });
-
- 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<string>("EncryptedBlobKey")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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>("UpdatedByUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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.HasIndex("UpdatedByUserId");
-
- 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<string>("GrantSignature")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("GrantSignerPublicKey")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("GrantSignerUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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.VaultManifestShareDetails", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedName")
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId");
-
- b.ToTable("VaultManifestShareDetails");
- });
-
- 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>("UpdatedByUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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.HasIndex("UpdatedByUserId");
-
- 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.EmailClaim", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.SetNull);
-
- 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.UserSigningKey", 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.HasOne("AliasServerDb.AliasVaultUser", "UpdatedByUser")
- .WithMany()
- .HasForeignKey("UpdatedByUserId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("OwnerGroup");
-
- b.Navigation("UpdatedByUser");
- });
-
- 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.VaultManifestShareDetails", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithOne()
- .HasForeignKey("AliasServerDb.VaultManifestShareDetails", "ManifestId")
- .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.HasOne("AliasServerDb.AliasVaultUser", "UpdatedByUser")
- .WithMany()
- .HasForeignKey("UpdatedByUserId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("Manifest");
-
- b.Navigation("UpdatedByUser");
- });
-
- 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.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/20261005080213_AddAccountSigningKeys.cs b/apps/server/Databases/AliasServerDb/Migrations/20261005080213_AddAccountSigningKeys.cs
deleted file mode 100644
index b5c921a32..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20261005080213_AddAccountSigningKeys.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations
-{
- /// <inheritdoc />
- public partial class AddAccountSigningKeys : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<string>(
- name: "GrantSignature",
- table: "VaultManifestAccessKeys",
- type: "character varying(255)",
- maxLength: 255,
- nullable: true);
-
- migrationBuilder.AddColumn<string>(
- name: "GrantSignerPublicKey",
- table: "VaultManifestAccessKeys",
- type: "character varying(100)",
- maxLength: 100,
- nullable: true);
-
- migrationBuilder.AddColumn<string>(
- name: "GrantSignerUserId",
- table: "VaultManifestAccessKeys",
- type: "character varying(255)",
- maxLength: 255,
- nullable: true);
-
- migrationBuilder.AddColumn<string>(
- name: "PublicKeySignature",
- table: "UserGrantKeys",
- type: "character varying(255)",
- maxLength: 255,
- nullable: false,
- defaultValue: "");
-
- migrationBuilder.AddColumn<string>(
- name: "EncryptedNameSignature",
- table: "GroupInvitations",
- type: "character varying(255)",
- maxLength: 255,
- nullable: true);
-
- migrationBuilder.AddColumn<string>(
- name: "GrantSignature",
- table: "GroupInvitations",
- type: "character varying(255)",
- maxLength: 255,
- nullable: true);
-
- migrationBuilder.AddColumn<string>(
- name: "GrantSignerPublicKey",
- table: "GroupInvitations",
- type: "character varying(100)",
- maxLength: 100,
- nullable: true);
-
- migrationBuilder.CreateTable(
- name: "UserSigningKeys",
- columns: table => new
- {
- 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(100)", maxLength: 100, nullable: false),
- EncryptedPrivateKey = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
- IsPrimary = table.Column<bool>(type: "boolean", nullable: false),
- AccountKeyVersion = table.Column<int>(type: "integer", nullable: false),
- CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
- UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_UserSigningKeys", x => x.Id);
- table.ForeignKey(
- name: "FK_UserSigningKeys_AliasVaultUsers_UserId",
- column: x => x.UserId,
- principalTable: "AliasVaultUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "UX_UserSigningKeys_User_Primary",
- table: "UserSigningKeys",
- column: "UserId",
- unique: true,
- filter: "\"IsPrimary\"");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "UserSigningKeys");
-
- migrationBuilder.DropColumn(
- name: "GrantSignature",
- table: "VaultManifestAccessKeys");
-
- migrationBuilder.DropColumn(
- name: "GrantSignerPublicKey",
- table: "VaultManifestAccessKeys");
-
- migrationBuilder.DropColumn(
- name: "GrantSignerUserId",
- table: "VaultManifestAccessKeys");
-
- migrationBuilder.DropColumn(
- name: "PublicKeySignature",
- table: "UserGrantKeys");
-
- migrationBuilder.DropColumn(
- name: "EncryptedNameSignature",
- table: "GroupInvitations");
-
- migrationBuilder.DropColumn(
- name: "GrantSignature",
- table: "GroupInvitations");
-
- migrationBuilder.DropColumn(
- name: "GrantSignerPublicKey",
- table: "GroupInvitations");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20261005085136_HashRefreshTokens.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20261005085136_HashRefreshTokens.Designer.cs
index 82c542549..71a8bcbad 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20261005085136_HashRefreshTokens.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20261005085136_HashRefreshTokens.Designer.cs
@@ -1130,8 +1130,8 @@ namespace AliasServerDb.Migrations
b.Property<string>("EncryptedPrivateKey")
.IsRequired()
- .HasMaxLength(4000)
- .HasColumnType("character varying(4000)");
+ .HasMaxLength(8000)
+ .HasColumnType("character varying(8000)");
b.Property<bool>("IsPrimary")
.HasColumnType("boolean");
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20261005090715_UniqueUserNameAndSrpIdentity.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20261005090715_UniqueUserNameAndSrpIdentity.Designer.cs
index ff1ab4e52..a4c206697 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20261005090715_UniqueUserNameAndSrpIdentity.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20261005090715_UniqueUserNameAndSrpIdentity.Designer.cs
@@ -1138,8 +1138,8 @@ namespace AliasServerDb.Migrations
b.Property<string>("EncryptedPrivateKey")
.IsRequired()
- .HasMaxLength(4000)
- .HasColumnType("character varying(4000)");
+ .HasMaxLength(8000)
+ .HasColumnType("character varying(8000)");
b.Property<bool>("IsPrimary")
.HasColumnType("boolean");
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20261005092112_WidenEncryptedPrivateKey.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20261005092112_WidenEncryptedPrivateKey.Designer.cs
deleted file mode 100644
index 5b3755180..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20261005092112_WidenEncryptedPrivateKey.Designer.cs
+++ /dev/null
@@ -1,2208 +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("20261005092112_WidenEncryptedPrivateKey")]
- partial class WidenEncryptedPrivateKey
- {
- /// <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("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UX_AliasVaultUsers_NormalizedUserName");
-
- b.HasIndex("PersonalGroupId")
- .IsUnique()
- .HasDatabaseName("UX_AliasVaultUsers_PersonalGroupId");
-
- b.HasIndex("SrpIdentity")
- .IsUnique()
- .HasDatabaseName("UX_AliasVaultUsers_SrpIdentity");
-
- 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>("PreviousTokenHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("TokenHash")
- .IsRequired()
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("UserId")
- .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<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("VaultManifestId", "CreatedAt");
-
- b.HasIndex("VaultManifestId", "State");
-
- b.ToTable("EmailClaims");
- });
-
- 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<string>("Type")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- 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>("EncryptedNameSignature")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("EncryptedVek")
- .HasColumnType("text");
-
- b.Property<string>("GrantSignature")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("GrantSignerPublicKey")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- 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<string>("Role")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- 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<string>("Role")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- 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>("ClientBrowser")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("ClientName")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientOperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientPublicKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("DeclinedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedAccountKey")
- .HasColumnType("text");
-
- b.Property<DateTime?>("FulfilledAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("MobileIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("PollSecretHash")
- .IsRequired()
- .HasMaxLength(44)
- .HasColumnType("character varying(44)");
-
- 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.RegistrationInvite", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Code")
- .IsRequired()
- .HasMaxLength(32)
- .HasColumnType("character varying(32)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("ExpiresAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("MaxUses")
- .HasColumnType("integer");
-
- b.Property<string>("Note")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<int>("UseCount")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "Code" }, "IX_RegistrationInvite_Code")
- .IsUnique();
-
- b.ToTable("RegistrationInvites");
- });
-
- 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(8000)
- .HasColumnType("character varying(8000)");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("boolean");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<string>("PublicKeySignature")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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.UserSigningKey", 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(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("boolean");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- 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_UserSigningKeys_User_Primary")
- .HasFilter("\"IsPrimary\"");
-
- b.ToTable("UserSigningKeys");
- });
-
- 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<string>("EncryptedBlobKey")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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>("UpdatedByUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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.HasIndex("UpdatedByUserId");
-
- 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<string>("GrantSignature")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("GrantSignerPublicKey")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("GrantSignerUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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.VaultManifestShareDetails", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedName")
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId");
-
- b.ToTable("VaultManifestShareDetails");
- });
-
- 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>("UpdatedByUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- 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.HasIndex("UpdatedByUserId");
-
- 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.EmailClaim", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.SetNull);
-
- 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.UserSigningKey", 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.HasOne("AliasServerDb.AliasVaultUser", "UpdatedByUser")
- .WithMany()
- .HasForeignKey("UpdatedByUserId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("OwnerGroup");
-
- b.Navigation("UpdatedByUser");
- });
-
- 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.VaultManifestShareDetails", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithOne()
- .HasForeignKey("AliasServerDb.VaultManifestShareDetails", "ManifestId")
- .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.HasOne("AliasServerDb.AliasVaultUser", "UpdatedByUser")
- .WithMany()
- .HasForeignKey("UpdatedByUserId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("Manifest");
-
- b.Navigation("UpdatedByUser");
- });
-
- 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.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/20261005092112_WidenEncryptedPrivateKey.cs b/apps/server/Databases/AliasServerDb/Migrations/20261005092112_WidenEncryptedPrivateKey.cs
deleted file mode 100644
index 94ff991bb..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20261005092112_WidenEncryptedPrivateKey.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations
-{
- /// <inheritdoc />
- public partial class WidenEncryptedPrivateKey : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AlterColumn<string>(
- name: "EncryptedPrivateKey",
- table: "UserGrantKeys",
- type: "character varying(8000)",
- maxLength: 8000,
- nullable: false,
- oldClrType: typeof(string),
- oldType: "character varying(4000)",
- oldMaxLength: 4000);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AlterColumn<string>(
- name: "EncryptedPrivateKey",
- table: "UserGrantKeys",
- type: "character varying(4000)",
- maxLength: 4000,
- nullable: false,
- oldClrType: typeof(string),
- oldType: "character varying(8000)",
- oldMaxLength: 8000);
- }
- }
-}