Skip to content

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

Recreate and combine migrations (#2159)

Leendert de Borst0200d621395f
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260811192745_DropUnusedIdentityTables.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedIdentityTablesAndWidenAuthLogPath.Designer.cs
similarity index 59%
rename from apps/server/Databases/AliasServerDb/Migrations/20260811192745_DropUnusedIdentityTables.Designer.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedIdentityTablesAndWidenAuthLogPath.Designer.cs
index 4de37968c..360ac9c71 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260811192745_DropUnusedIdentityTables.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedIdentityTablesAndWidenAuthLogPath.Designer.cs
@@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace AliasServerDb.Migrations
{
[DbContext(typeof(AliasServerDbContext))]
- [Migration("20260811192745_DropUnusedIdentityTables")]
- partial class DropUnusedIdentityTables
+ [Migration("20260810084712_DropUnusedIdentityTablesAndWidenAuthLogPath")]
+ partial class DropUnusedIdentityTablesAndWidenAuthLogPath
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -109,6 +109,9 @@ namespace AliasServerDb.Migrations
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
+ b.Property<int>("EmailsReceived")
+ .HasColumnType("integer");
+
b.Property<DateTime?>("LastActivityDate")
.HasColumnType("timestamp with time zone");
@@ -118,6 +121,12 @@ namespace AliasServerDb.Migrations
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("timestamp with time zone");
+ b.Property<int>("MaxEmailAgeDays")
+ .HasColumnType("integer");
+
+ b.Property<int>("MaxEmails")
+ .HasColumnType("integer");
+
b.Property<string>("NormalizedEmail")
.HasColumnType("text");
@@ -130,9 +139,6 @@ namespace AliasServerDb.Migrations
b.Property<string>("PasswordHash")
.HasColumnType("text");
- b.Property<Guid>("PersonalGroupId")
- .HasColumnType("uuid");
-
b.Property<string>("PhoneNumber")
.HasColumnType("text");
@@ -142,6 +148,12 @@ namespace AliasServerDb.Migrations
b.Property<string>("SecurityStamp")
.HasColumnType("text");
+ b.Property<bool>("ShadowBlocked")
+ .HasColumnType("boolean");
+
+ b.Property<DateTime?>("ShadowBlockedAt")
+ .HasColumnType("timestamp with time zone");
+
b.Property<string>("SrpIdentity")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
@@ -157,10 +169,6 @@ namespace AliasServerDb.Migrations
b.HasKey("Id");
- b.HasIndex("PersonalGroupId")
- .IsUnique()
- .HasDatabaseName("UX_AliasVaultUsers_PersonalGroupId");
-
b.ToTable("AliasVaultUsers");
});
@@ -255,8 +263,8 @@ namespace AliasServerDb.Migrations
.HasColumnType("character varying(100)");
b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
b.Property<DateTime>("Timestamp")
.HasColumnType("timestamp with time zone");
@@ -340,15 +348,16 @@ namespace AliasServerDb.Migrations
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>("EncryptedSymmetricKey")
+ .IsRequired()
+ .HasColumnType("text");
+
b.Property<string>("From")
.IsRequired()
.HasColumnType("text");
@@ -371,11 +380,9 @@ namespace AliasServerDb.Migrations
.HasColumnType("text");
b.Property<string>("MessageSource")
+ .IsRequired()
.HasColumnType("text");
- b.Property<byte[]>("MessageSourceBytes")
- .HasColumnType("bytea");
-
b.Property<bool>("PushNotificationSent")
.HasColumnType("boolean");
@@ -395,6 +402,10 @@ namespace AliasServerDb.Migrations
.IsRequired()
.HasColumnType("text");
+ b.Property<Guid>("UserEncryptionKeyId")
+ .HasMaxLength(255)
+ .HasColumnType("uuid");
+
b.Property<bool>("Visible")
.HasColumnType("boolean");
@@ -406,6 +417,8 @@ namespace AliasServerDb.Migrations
b.HasIndex("PushNotificationSent");
+ b.HasIndex("UserEncryptionKeyId");
+
b.HasIndex("Visible");
b.HasIndex("To", "DateSystem");
@@ -449,157 +462,6 @@ namespace AliasServerDb.Migrations
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<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.ToTable("EmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.Property<Guid>("EmailClaimId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.HasKey("EmailClaimId", "VaultManifestId");
-
- b.HasIndex("VaultManifestId", "EmailClaimId");
-
- b.HasIndex("EmailClaimId")
- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")
- .HasFilter("\"State\" <> 'Removed'");
-
- b.ToTable("EmailClaimLinks");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<Guid>("VaultManifestDeliveryKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("EmailId", "VaultManifestDeliveryKeyId");
-
- b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");
-
- b.ToTable("EmailDecryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailsReceived")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmailAgeDays")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmails")
- .HasColumnType("integer");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("ShadowBlocked")
- .HasColumnType("boolean");
-
- b.Property<DateTime?>("ShadowBlockedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Type")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.ToTable("Groups");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.HasIndex("GroupId", "UserId")
- .IsUnique();
-
- b.ToTable("GroupMembers");
- });
-
modelBuilder.Entity("AliasServerDb.Log", b =>
{
b.Property<int>("Id")
@@ -729,9 +591,6 @@ namespace AliasServerDb.Migrations
b.Property<bool>("Enabled")
.HasColumnType("boolean");
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
b.Property<int>("LimitType")
.HasColumnType("integer");
@@ -748,15 +607,19 @@ namespace AliasServerDb.Migrations
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
+ b.Property<string>("UserId")
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
+
b.Property<int>("WindowSeconds")
.HasColumnType("integer");
b.HasKey("Id");
- b.HasIndex("GroupId");
-
b.HasIndex("Tier");
+ b.HasIndex("UserId");
+
b.HasIndex("LimitType", "Enabled");
b.ToTable("RateLimits");
@@ -818,85 +681,68 @@ namespace AliasServerDb.Migrations
b.ToTable("TaskRunnerJobs");
});
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
+ modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
- b.Property<int>("AccountKeyVersion")
- .HasColumnType("integer");
+ b.Property<string>("Address")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
+ b.Property<string>("AddressDomain")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
- b.Property<string>("EncryptedPrivateKey")
+ b.Property<string>("AddressLocal")
.IsRequired()
- .HasMaxLength(4000)
- .HasColumnType("character varying(4000)");
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
- b.Property<bool>("IsPrimary")
- .HasColumnType("boolean");
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("timestamp with time zone");
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
+ b.Property<bool>("Disabled")
+ .HasColumnType("boolean");
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.HasIndex("Address")
+ .IsUnique();
+
+ b.HasIndex("UserId", "CreatedAt");
+
+ b.HasIndex("UserId", "Disabled");
- b.ToTable("UserGrantKeys");
+ b.ToTable("UserEmailClaims");
});
- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
+ modelBuilder.Entity("AliasServerDb.UserEncryptionKey", 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<bool>("IsPrimary")
+ .HasColumnType("boolean");
- b.Property<string>("Type")
+ b.Property<string>("PublicKey")
.IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
+ .HasMaxLength(2000)
+ .HasColumnType("character varying(2000)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
@@ -908,378 +754,76 @@ namespace AliasServerDb.Migrations
b.HasKey("Id");
- b.HasIndex("UserId", "Type", "Label")
- .IsUnique()
- .HasDatabaseName("UX_UserUnlockKeys_UserId_Type_Label");
+ b.HasIndex("UserId");
- b.ToTable("UserUnlockKeys");
+ b.ToTable("UserEncryptionKeys");
});
- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>
+ modelBuilder.Entity("AliasServerDb.Vault", b =>
{
- b.Property<string>("Hash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<string>("OwnerUserId")
+ b.Property<string>("Client")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
- b.Property<string>("Category")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
+ b.Property<int>("CredentialsCount")
.HasColumnType("integer");
- b.Property<DateTime>("LastReferencedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("SizeBytes")
+ b.Property<int>("EmailClaimsCount")
.HasColumnType("integer");
- b.HasKey("Hash", "OwnerUserId");
-
- b.HasIndex("OwnerUserId", "Category");
+ b.Property<string>("EncryptionSettings")
+ .IsRequired()
+ .HasColumnType("text");
- b.ToTable("VaultBlobObjects");
- });
+ b.Property<string>("EncryptionType")
+ .IsRequired()
+ .HasColumnType("text");
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
+ b.Property<int>("FileSize")
+ .HasColumnType("integer");
b.Property<long>("RevisionNumber")
.HasColumnType("bigint");
- b.Property<string>("BlobHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
+ b.Property<string>("Salt")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");
+ b.Property<DateTime>("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
- b.ToTable("VaultBlobReferences");
- });
+ b.Property<string>("UserId")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
- 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<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("OwnerGroupId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
+ b.Property<string>("VaultBlob")
+ .IsRequired()
+ .HasColumnType("text");
b.Property<string>("Verifier")
+ .IsRequired()
.HasMaxLength(1000)
.HasColumnType("character varying(1000)");
b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId");
-
- b.HasIndex("OwnerGroupId");
-
- b.ToTable("VaultManifests");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedVek")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Metadata")
- .HasColumnType("jsonb");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("UserId")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
b.HasKey("Id");
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("VaultManifestId")
- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");
-
- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");
-
- b.ToTable("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("boolean");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("VaultManifestId")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")
- .HasFilter("\"IsPrimary\"");
-
- b.HasIndex("VaultManifestId", "IsPrimary");
-
- b.ToTable("VaultManifestDeliveryKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId", "RevisionNumber");
+ b.HasIndex("UserId");
- b.ToTable("VaultManifestsHistory", (string)null);
+ b.ToTable("Vaults");
});
modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
@@ -1373,17 +917,6 @@ namespace AliasServerDb.Migrations
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")
@@ -1395,73 +928,26 @@ namespace AliasServerDb.Migrations
b.Navigation("User");
});
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
+ modelBuilder.Entity("AliasServerDb.Email", b =>
{
- b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")
- .WithMany("Links")
- .HasForeignKey("EmailClaimId")
+ b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
+ .WithMany("Emails")
+ .HasForeignKey("UserEncryptionKeyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EmailClaim");
-
- b.Navigation("VaultManifest");
+ b.Navigation("EncryptionKey");
});
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
+ modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
{
b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("DecryptionKeys")
+ .WithMany("Attachments")
.HasForeignKey("EmailId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")
- .WithMany("DecryptionKeys")
- .HasForeignKey("VaultManifestDeliveryKeyId")
- .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
b.Navigation("Email");
-
- b.Navigation("VaultManifestDeliveryKey");
- });
-
- 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 =>
@@ -1475,157 +961,64 @@ namespace AliasServerDb.Migrations
});
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();
+ .OnDelete(DeleteBehavior.Cascade);
b.Navigation("User");
});
- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
+ modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
{
b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
+ .WithMany("EmailClaims")
.HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
+ .OnDelete(DeleteBehavior.SetNull);
b.Navigation("User");
});
- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>
+ modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
{
b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("OwnerUserId")
+ .WithMany("EncryptionKeys")
+ .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
+ modelBuilder.Entity("AliasServerDb.Vault", b =>
{
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")
- .WithMany()
- .HasForeignKey("ManifestId", "Category")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Bucket");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.HasOne("AliasServerDb.Group", "OwnerGroup")
- .WithMany()
- .HasForeignKey("OwnerGroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("OwnerGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("VaultManifestAccessKeys")
+ .WithMany("Vaults")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
-
- b.Navigation("UserGrantKey");
});
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
+ modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
{
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
+ b.Navigation("EmailClaims");
- b.Navigation("Manifest");
- });
+ b.Navigation("EncryptionKeys");
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("VaultManifestAccessKeys");
+ b.Navigation("Vaults");
});
modelBuilder.Entity("AliasServerDb.Email", b =>
{
b.Navigation("Attachments");
-
- b.Navigation("DecryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Navigation("Links");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Navigation("Members");
});
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
+ modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
{
- b.Navigation("DecryptionKeys");
+ b.Navigation("Emails");
});
#pragma warning restore 612, 618
}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260811192745_DropUnusedIdentityTables.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedIdentityTablesAndWidenAuthLogPath.cs
similarity index 77%
rename from apps/server/Databases/AliasServerDb/Migrations/20260811192745_DropUnusedIdentityTables.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedIdentityTablesAndWidenAuthLogPath.cs
index 7344b7d53..429d9efec 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260811192745_DropUnusedIdentityTables.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260810084712_DropUnusedIdentityTablesAndWidenAuthLogPath.cs
@@ -1,12 +1,15 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace AliasServerDb.Migrations
{
- /// <inheritdoc />
- public partial class DropUnusedIdentityTables : Migration
+ /// <summary>
+ /// Drops the ASP.NET Identity tables that AliasVault does not use, and widens the audit log request path so the
+ /// longer v2 API routes still fit.
+ /// </summary>
+ public partial class DropUnusedIdentityTablesAndWidenAuthLogPath : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
@@ -25,11 +28,33 @@ namespace AliasServerDb.Migrations
migrationBuilder.DropTable(
name: "UserRoles");
+
+ migrationBuilder.AlterColumn<string>(
+ name: "RequestPath",
+ table: "AuthLogs",
+ type: "character varying(255)",
+ maxLength: 255,
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "character varying(100)",
+ oldMaxLength: 100,
+ oldNullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
+ migrationBuilder.AlterColumn<string>(
+ name: "RequestPath",
+ table: "AuthLogs",
+ type: "character varying(100)",
+ maxLength: 100,
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "character varying(255)",
+ oldMaxLength: 255,
+ oldNullable: true);
+
migrationBuilder.CreateTable(
name: "AdminRoles",
columns: table => new
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.cs
index 80371d750..50294bca0 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.cs
@@ -293,8 +293,8 @@ namespace AliasServerDb.Migrations
.HasColumnType("character varying(100)");
b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
b.Property<DateTime>("Timestamp")
.HasColumnType("timestamp with time zone");
@@ -834,6 +834,9 @@ namespace AliasServerDb.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
+ b.Property<int>("AccountKeyVersion")
+ .HasColumnType("integer");
+
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
@@ -874,6 +877,9 @@ namespace AliasServerDb.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
+ b.Property<int>("AccountKeyVersion")
+ .HasColumnType("integer");
+
b.Property<string>("Algorithm")
.IsRequired()
.HasMaxLength(30)
@@ -886,6 +892,11 @@ namespace AliasServerDb.Migrations
.IsRequired()
.HasColumnType("text");
+ b.Property<string>("Label")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
b.Property<DateTime?>("LastUsedAt")
.HasColumnType("timestamp with time zone");
@@ -907,9 +918,9 @@ namespace AliasServerDb.Migrations
b.HasKey("Id");
- b.HasIndex("UserId", "Type")
+ b.HasIndex("UserId", "Type", "Label")
.IsUnique()
- .HasDatabaseName("UX_UserUnlockKeys_UserId_Type");
+ .HasDatabaseName("UX_UserUnlockKeys_UserId_Type_Label");
b.ToTable("UserUnlockKeys");
});
@@ -936,6 +947,9 @@ namespace AliasServerDb.Migrations
.IsRequired()
.HasColumnType("bytea");
+ b.Property<int>("KeyVersion")
+ .HasColumnType("integer");
+
b.Property<DateTime>("LastReferencedAt")
.HasColumnType("timestamp with time zone");
@@ -986,6 +1000,9 @@ namespace AliasServerDb.Migrations
.IsRequired()
.HasColumnType("bytea");
+ b.Property<int>("KeyVersion")
+ .HasColumnType("integer");
+
b.Property<long>("RevisionNumber")
.HasColumnType("bigint");
@@ -1020,6 +1037,9 @@ namespace AliasServerDb.Migrations
.IsRequired()
.HasColumnType("bytea");
+ b.Property<int>("KeyVersion")
+ .HasColumnType("integer");
+
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
@@ -1056,6 +1076,9 @@ namespace AliasServerDb.Migrations
b.Property<int>("FileSize")
.HasColumnType("integer");
+ b.Property<int>("KeyVersion")
+ .HasColumnType("integer");
+
b.Property<byte[]>("ManifestBlob")
.HasColumnType("bytea");
@@ -1063,10 +1086,6 @@ namespace AliasServerDb.Migrations
.HasMaxLength(64)
.HasColumnType("character varying(64)");
- b.Property<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
b.Property<Guid>("OwnerGroupId")
.HasColumnType("uuid");
@@ -1109,6 +1128,9 @@ namespace AliasServerDb.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
+ b.Property<int?>("AccountKeyVersion")
+ .HasColumnType("integer");
+
b.Property<string>("Algorithm")
.IsRequired()
.HasMaxLength(30)
@@ -1121,6 +1143,9 @@ namespace AliasServerDb.Migrations
.IsRequired()
.HasColumnType("text");
+ b.Property<int>("KeyVersion")
+ .HasColumnType("integer");
+
b.Property<DateTime?>("LastUsedAt")
.HasColumnType("timestamp with time zone");
@@ -1153,9 +1178,9 @@ namespace AliasServerDb.Migrations
b.HasIndex("VaultManifestId")
.HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");
- b.HasIndex("UserId", "Type", "VaultManifestId")
+ b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")
.IsUnique()
- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest");
+ .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");
b.ToTable("VaultManifestAccessKeys");
});
@@ -1225,6 +1250,9 @@ namespace AliasServerDb.Migrations
b.Property<int>("FileSize")
.HasColumnType("integer");
+ b.Property<int>("KeyVersion")
+ .HasColumnType("integer");
+
b.Property<byte[]>("ManifestBlob")
.HasColumnType("bytea");
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.cs
index 757e462ba..35b1ec873 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.cs
@@ -14,7 +14,9 @@ namespace AliasServerDb.Migrations
/// "VaultManifestsHistory" tail, keyed by a newly minted manifest id,
/// - per-user email encryption keys become per-manifest delivery keys.
///
- /// The tables that only the manifest-v1 write path uses (buckets, blobs, access and unlock keys) start empty.
+ /// The tables that only the manifest-v1 write path uses (buckets, blobs, access and unlock keys) start empty. Every
+ /// ciphertext they hold carries the version of the key it was written with, so a future key rotation can tell the
+ /// generations apart.
/// </summary>
public partial class ManifestStorageAndGroupOwnership : Migration
{
@@ -153,10 +155,10 @@ namespace AliasServerDb.Migrations
migrationBuilder.AddColumn<Guid>(name: "ManifestId", table: "VaultManifests", type: "uuid", nullable: true);
migrationBuilder.AddColumn<Guid>(name: "OwnerGroupId", table: "VaultManifests", type: "uuid", nullable: true);
- migrationBuilder.AddColumn<string>(name: "Name", table: "VaultManifests", type: "character varying(255)", maxLength: 255, nullable: true);
migrationBuilder.AddColumn<string>(name: "StorageFormat", table: "VaultManifests", type: "character varying(20)", maxLength: 20, nullable: true);
migrationBuilder.AddColumn<byte[]>(name: "ManifestBlob", table: "VaultManifests", type: "bytea", nullable: true);
migrationBuilder.AddColumn<string>(name: "ManifestCiphertextHash", table: "VaultManifests", type: "character varying(64)", maxLength: 64, nullable: true);
+ migrationBuilder.AddColumn<int>(name: "KeyVersion", table: "VaultManifests", type: "integer", nullable: false, defaultValue: 0);
// A manifest-v1 revision carries no vault blob and no SRP credentials, so the columns that only the legacy
// sqlite-blob format fills become nullable. NULL is the sole "not applicable" marker; the empty string is not.
@@ -179,23 +181,24 @@ namespace AliasServerDb.Migrations
name: "VaultManifestsHistory",
columns: table => new
{
- RevisionNumber = table.Column<long>(type: "bigint", nullable: false),
ManifestId = table.Column<Guid>(type: "uuid", nullable: false),
- VaultBlob = table.Column<string>(type: "text", nullable: true),
+ RevisionNumber = table.Column<long>(type: "bigint", nullable: false),
StorageFormat = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
ManifestBlob = table.Column<byte[]>(type: "bytea", nullable: true),
ManifestCiphertextHash = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
- Version = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
+ KeyVersion = table.Column<int>(type: "integer", nullable: false, defaultValue: 0),
FileSize = table.Column<int>(type: "integer", nullable: false),
- Salt = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
- Verifier = table.Column<string>(type: "character varying(1000)", maxLength: 1000, nullable: true),
CredentialsCount = table.Column<int>(type: "integer", nullable: false),
EmailClaimsCount = table.Column<int>(type: "integer", nullable: false),
- EncryptionType = table.Column<string>(type: "text", nullable: true),
- EncryptionSettings = table.Column<string>(type: "text", nullable: true),
Client = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
- UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
+ UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
+ VaultBlob = table.Column<string>(type: "text", nullable: true),
+ Version = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
+ Salt = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
+ Verifier = table.Column<string>(type: "character varying(1000)", maxLength: 1000, nullable: true),
+ EncryptionType = table.Column<string>(type: "text", nullable: true),
+ EncryptionSettings = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
@@ -423,6 +426,7 @@ namespace AliasServerDb.Migrations
UserId = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
PublicKey = table.Column<string>(type: "character varying(2000)", maxLength: 2000, nullable: false),
EncryptedPrivateKey = table.Column<string>(type: "character varying(4000)", maxLength: 4000, nullable: false),
+ AccountKeyVersion = table.Column<int>(type: "integer", nullable: false, defaultValue: 0),
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)
@@ -445,8 +449,10 @@ namespace AliasServerDb.Migrations
Id = table.Column<Guid>(type: "uuid", nullable: false),
UserId = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
Type = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
+ Label = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false, defaultValue: ""),
Algorithm = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
EncryptedAccountKey = table.Column<string>(type: "text", nullable: false),
+ AccountKeyVersion = table.Column<int>(type: "integer", nullable: false, defaultValue: 0),
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),
@@ -473,7 +479,9 @@ namespace AliasServerDb.Migrations
Type = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
Algorithm = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
EncryptedVek = table.Column<string>(type: "text", nullable: false),
+ 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),
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),
@@ -505,6 +513,7 @@ namespace AliasServerDb.Migrations
Category = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
EncryptedData = table.Column<byte[]>(type: "bytea", nullable: false),
SizeBytes = table.Column<int>(type: "integer", nullable: false),
+ KeyVersion = table.Column<int>(type: "integer", nullable: false, defaultValue: 0),
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
LastReferencedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
@@ -544,9 +553,10 @@ namespace AliasServerDb.Migrations
{
ManifestId = table.Column<Guid>(type: "uuid", nullable: false),
Category = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
- EncryptedData = table.Column<byte[]>(type: "bytea", nullable: false),
RevisionNumber = table.Column<long>(type: "bigint", nullable: false),
+ EncryptedData = table.Column<byte[]>(type: "bytea", nullable: false),
CiphertextHash = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
+ KeyVersion = table.Column<int>(type: "integer", nullable: false, defaultValue: 0),
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
@@ -565,11 +575,12 @@ namespace AliasServerDb.Migrations
name: "VaultDataBucketsHistory",
columns: table => new
{
- RevisionNumber = table.Column<long>(type: "bigint", nullable: false),
ManifestId = table.Column<Guid>(type: "uuid", nullable: false),
Category = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
+ RevisionNumber = table.Column<long>(type: "bigint", nullable: false),
EncryptedData = table.Column<byte[]>(type: "bytea", nullable: false),
CiphertextHash = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
+ KeyVersion = table.Column<int>(type: "integer", nullable: false, defaultValue: 0),
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
@@ -585,10 +596,10 @@ namespace AliasServerDb.Migrations
});
migrationBuilder.CreateIndex(name: "UX_UserGrantKeys_User_Primary", table: "UserGrantKeys", column: "UserId", unique: true, filter: "\"IsPrimary\"");
- migrationBuilder.CreateIndex(name: "UX_UserUnlockKeys_UserId_Type", table: "UserUnlockKeys", columns: new[] { "UserId", "Type" }, unique: true);
+ migrationBuilder.CreateIndex(name: "UX_UserUnlockKeys_UserId_Type_Label", table: "UserUnlockKeys", columns: new[] { "UserId", "Type", "Label" }, unique: true);
migrationBuilder.CreateIndex(name: "IX_VaultManifestAccessKeys_UserGrantKeyId", table: "VaultManifestAccessKeys", column: "UserGrantKeyId");
migrationBuilder.CreateIndex(name: "IX_VaultManifestAccessKeys_VaultManifestId", table: "VaultManifestAccessKeys", column: "VaultManifestId");
- migrationBuilder.CreateIndex(name: "UX_VaultManifestAccessKeys_UserId_Type_Manifest", table: "VaultManifestAccessKeys", columns: new[] { "UserId", "Type", "VaultManifestId" }, unique: true);
+ migrationBuilder.CreateIndex(name: "UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version", table: "VaultManifestAccessKeys", columns: new[] { "UserId", "Type", "VaultManifestId", "KeyVersion" }, unique: true);
migrationBuilder.CreateIndex(name: "IX_VaultBlobObjects_OwnerUserId_Category", table: "VaultBlobObjects", columns: new[] { "OwnerUserId", "Category" });
}
@@ -779,8 +790,8 @@ namespace AliasServerDb.Migrations
migrationBuilder.AddPrimaryKey(name: "PK_VaultManifests", table: "VaultManifests", column: "Id");
migrationBuilder.Sql("""
- INSERT INTO "VaultManifests" ("Id", "ManifestId", "OwnerGroupId", "UserId", "Name", "VaultBlob", "StorageFormat", "ManifestBlob", "ManifestCiphertextHash", "Version", "RevisionNumber", "FileSize", "Salt", "Verifier", "CredentialsCount", "EmailClaimsCount", "EncryptionType", "EncryptionSettings", "Client", "CreatedAt", "UpdatedAt")
- SELECT gen_random_uuid(), h."ManifestId", m."OwnerGroupId", m."UserId", m."Name", h."VaultBlob", h."StorageFormat", h."ManifestBlob", h."ManifestCiphertextHash", h."Version", h."RevisionNumber", h."FileSize", h."Salt", h."Verifier", h."CredentialsCount", h."EmailClaimsCount", h."EncryptionType", h."EncryptionSettings", h."Client", h."CreatedAt", h."UpdatedAt"
+ INSERT INTO "VaultManifests" ("Id", "ManifestId", "OwnerGroupId", "UserId", "VaultBlob", "StorageFormat", "ManifestBlob", "ManifestCiphertextHash", "Version", "RevisionNumber", "FileSize", "Salt", "Verifier", "CredentialsCount", "EmailClaimsCount", "EncryptionType", "EncryptionSettings", "Client", "CreatedAt", "UpdatedAt")
+ SELECT gen_random_uuid(), h."ManifestId", m."OwnerGroupId", m."UserId", h."VaultBlob", h."StorageFormat", h."ManifestBlob", h."ManifestCiphertextHash", h."Version", h."RevisionNumber", h."FileSize", h."Salt", h."Verifier", h."CredentialsCount", h."EmailClaimsCount", h."EncryptionType", h."EncryptionSettings", h."Client", h."CreatedAt", h."UpdatedAt"
FROM "VaultManifestsHistory" h
INNER JOIN "VaultManifests" m ON m."ManifestId" = h."ManifestId";
""");
@@ -790,7 +801,7 @@ namespace AliasServerDb.Migrations
migrationBuilder.DropColumn(name: "ManifestId", table: "VaultManifests");
migrationBuilder.DropColumn(name: "OwnerGroupId", table: "VaultManifests");
- migrationBuilder.DropColumn(name: "Name", table: "VaultManifests");
+ migrationBuilder.DropColumn(name: "KeyVersion", table: "VaultManifests");
migrationBuilder.DropColumn(name: "StorageFormat", table: "VaultManifests");
migrationBuilder.DropColumn(name: "ManifestBlob", table: "VaultManifests");
migrationBuilder.DropColumn(name: "ManifestCiphertextHash", table: "VaultManifests");
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810113019_AddKeyVersionColumns.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810113019_AddKeyVersionColumns.Designer.cs
deleted file mode 100644
index d25ee040c..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260810113019_AddKeyVersionColumns.Designer.cs
+++ /dev/null
@@ -1,1672 +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("20260810113019_AddKeyVersionColumns")]
- partial class AddKeyVersionColumns
- {
- /// <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.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("text");
-
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- 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.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("text");
-
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- 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(100)
- .HasColumnType("character varying(100)");
-
- 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.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<DateTime>("Date")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<Guid>("EncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("uuid");
-
- 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")
- .IsRequired()
- .HasColumnType("text");
-
- 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("EncryptionKeyId");
-
- 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<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Disabled")
- .HasColumnType("boolean");
-
- 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", "Disabled");
-
- b.ToTable("EmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailsReceived")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmailAgeDays")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmails")
- .HasColumnType("integer");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("ShadowBlocked")
- .HasColumnType("boolean");
-
- b.Property<DateTime?>("ShadowBlockedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Type")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.ToTable("Groups");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.HasIndex("GroupId", "UserId")
- .IsUnique();
-
- b.ToTable("GroupMembers");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("text")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<DateTime?>("ClearedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ClientIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("ClientPublicKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedDecryptionKey")
- .HasColumnType("text");
-
- b.Property<DateTime?>("FulfilledAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("MobileIpAddress")
- .HasColumnType("text");
-
- b.Property<DateTime?>("RetrievedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");
-
- b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");
-
- b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");
-
- b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");
-
- b.HasIndex(new[] { "UserId" }, "IX_UserId");
-
- b.ToTable("MobileLoginRequests");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AppliesToAccountAgeMaxDays")
- .HasColumnType("integer");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("EffectiveFrom")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("EffectiveUntil")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("LimitType")
- .HasColumnType("integer");
-
- b.Property<int>("MaxCount")
- .HasColumnType("integer");
-
- b.Property<string>("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<int?>("Tier")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("WindowSeconds")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("Tier");
-
- b.HasIndex("LimitType", "Enabled");
-
- b.ToTable("RateLimits");
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("time without time zone");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("text");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("boolean");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("time without time zone");
-
- b.Property<int>("Status")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<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.VaultBlobObject", b =>
- {
- b.Property<string>("Hash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("OwnerUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Category")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("LastReferencedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("SizeBytes")
- .HasColumnType("integer");
-
- b.HasKey("Hash", "OwnerUserId");
-
- b.HasIndex("OwnerUserId", "Category");
-
- b.ToTable("VaultBlobObjects");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("BlobHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");
-
- b.ToTable("VaultBlobReferences");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category");
-
- b.ToTable("VaultDataBuckets");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category", "RevisionNumber");
-
- b.ToTable("VaultDataBucketsHistory");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.Property<Guid>("ManifestId")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("OwnerGroupId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId");
-
- b.HasIndex("OwnerGroupId");
-
- b.ToTable("VaultManifests");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedVek")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Metadata")
- .HasColumnType("jsonb");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("VaultManifestId")
- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");
-
- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");
-
- b.ToTable("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("boolean");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("VaultManifestId")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")
- .HasFilter("\"IsPrimary\"");
-
- b.HasIndex("VaultManifestId", "IsPrimary");
-
- b.ToTable("VaultManifestDeliveryKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId", "RevisionNumber");
-
- b.ToTable("VaultManifestsHistory", (string)null);
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("FriendlyName")
- .HasColumnType("text");
-
- b.Property<string>("Xml")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<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>("RoleId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- 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.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("text");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("text");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.Property<string>("RoleId")
- .HasColumnType("text");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (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.Email", b =>
- {
- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("EncryptionKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- 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.GroupMember", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany("Members")
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Group");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("Group");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("OwnerUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")
- .WithMany()
- .HasForeignKey("ManifestId", "Category")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Bucket");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.HasOne("AliasServerDb.Group", "OwnerGroup")
- .WithMany()
- .HasForeignKey("OwnerGroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("OwnerGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("VaultManifestAccessKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Navigation("Members");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810113019_AddKeyVersionColumns.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810113019_AddKeyVersionColumns.cs
deleted file mode 100644
index c69d87b15..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260810113019_AddKeyVersionColumns.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations
-{
- /// <inheritdoc />
- public partial class AddKeyVersionColumns : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropIndex(
- name: "UX_VaultManifestAccessKeys_UserId_Type_Manifest",
- table: "VaultManifestAccessKeys");
-
- migrationBuilder.DropIndex(
- name: "UX_UserUnlockKeys_UserId_Type",
- table: "UserUnlockKeys");
-
- migrationBuilder.AddColumn<int>(
- name: "KeyVersion",
- table: "VaultManifestsHistory",
- type: "integer",
- nullable: false,
- defaultValue: 0);
-
- migrationBuilder.AddColumn<int>(
- name: "KeyVersion",
- table: "VaultManifests",
- type: "integer",
- nullable: false,
- defaultValue: 0);
-
- migrationBuilder.AddColumn<int>(
- name: "AccountKeyVersion",
- table: "VaultManifestAccessKeys",
- type: "integer",
- nullable: true);
-
- migrationBuilder.AddColumn<int>(
- name: "KeyVersion",
- table: "VaultManifestAccessKeys",
- type: "integer",
- nullable: false,
- defaultValue: 0);
-
- migrationBuilder.AddColumn<int>(
- name: "KeyVersion",
- table: "VaultDataBucketsHistory",
- type: "integer",
- nullable: false,
- defaultValue: 0);
-
- migrationBuilder.AddColumn<int>(
- name: "KeyVersion",
- table: "VaultDataBuckets",
- type: "integer",
- nullable: false,
- defaultValue: 0);
-
- migrationBuilder.AddColumn<int>(
- name: "KeyVersion",
- table: "VaultBlobObjects",
- type: "integer",
- nullable: false,
- defaultValue: 0);
-
- migrationBuilder.AddColumn<int>(
- name: "AccountKeyVersion",
- table: "UserUnlockKeys",
- type: "integer",
- nullable: false,
- defaultValue: 0);
-
- migrationBuilder.AddColumn<string>(
- name: "Label",
- table: "UserUnlockKeys",
- type: "character varying(100)",
- maxLength: 100,
- nullable: false,
- defaultValue: "");
-
- migrationBuilder.AddColumn<int>(
- name: "AccountKeyVersion",
- table: "UserGrantKeys",
- type: "integer",
- nullable: false,
- defaultValue: 0);
-
- migrationBuilder.CreateIndex(
- name: "UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version",
- table: "VaultManifestAccessKeys",
- columns: new[] { "UserId", "Type", "VaultManifestId", "KeyVersion" },
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "UX_UserUnlockKeys_UserId_Type_Label",
- table: "UserUnlockKeys",
- columns: new[] { "UserId", "Type", "Label" },
- unique: true);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropIndex(
- name: "UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version",
- table: "VaultManifestAccessKeys");
-
- migrationBuilder.DropIndex(
- name: "UX_UserUnlockKeys_UserId_Type_Label",
- table: "UserUnlockKeys");
-
- migrationBuilder.DropColumn(
- name: "KeyVersion",
- table: "VaultManifestsHistory");
-
- migrationBuilder.DropColumn(
- name: "KeyVersion",
- table: "VaultManifests");
-
- migrationBuilder.DropColumn(
- name: "AccountKeyVersion",
- table: "VaultManifestAccessKeys");
-
- migrationBuilder.DropColumn(
- name: "KeyVersion",
- table: "VaultManifestAccessKeys");
-
- migrationBuilder.DropColumn(
- name: "KeyVersion",
- table: "VaultDataBucketsHistory");
-
- migrationBuilder.DropColumn(
- name: "KeyVersion",
- table: "VaultDataBuckets");
-
- migrationBuilder.DropColumn(
- name: "KeyVersion",
- table: "VaultBlobObjects");
-
- migrationBuilder.DropColumn(
- name: "AccountKeyVersion",
- table: "UserUnlockKeys");
-
- migrationBuilder.DropColumn(
- name: "Label",
- table: "UserUnlockKeys");
-
- migrationBuilder.DropColumn(
- name: "AccountKeyVersion",
- table: "UserGrantKeys");
-
- migrationBuilder.CreateIndex(
- name: "UX_VaultManifestAccessKeys_UserId_Type_Manifest",
- table: "VaultManifestAccessKeys",
- columns: new[] { "UserId", "Type", "VaultManifestId" },
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "UX_UserUnlockKeys_UserId_Type",
- table: "UserUnlockKeys",
- columns: new[] { "UserId", "Type" },
- unique: true);
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810154523_AddEmailMultiManifest.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810154523_AddEmailMultiManifest.Designer.cs
deleted file mode 100644
index c615a09dd..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260810154523_AddEmailMultiManifest.Designer.cs
+++ /dev/null
@@ -1,1720 +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("20260810154523_AddEmailMultiManifest")]
- partial class AddEmailMultiManifest
- {
- /// <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.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("text");
-
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- 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.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("text");
-
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- 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(100)
- .HasColumnType("character varying(100)");
-
- 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.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- 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")
- .IsRequired()
- .HasColumnType("text");
-
- 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<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.ToTable("EmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.Property<Guid>("EmailClaimId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.HasKey("EmailClaimId", "VaultManifestId");
-
- b.HasIndex("VaultManifestId", "EmailClaimId");
-
- b.HasIndex("EmailClaimId")
- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")
- .HasFilter("\"State\" <> 'Removed'");
-
- b.ToTable("EmailClaimLinks");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<Guid>("VaultManifestDeliveryKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("EmailId", "VaultManifestDeliveryKeyId");
-
- b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");
-
- b.ToTable("EmailDecryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailsReceived")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmailAgeDays")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmails")
- .HasColumnType("integer");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("ShadowBlocked")
- .HasColumnType("boolean");
-
- b.Property<DateTime?>("ShadowBlockedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Type")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.ToTable("Groups");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.HasIndex("GroupId", "UserId")
- .IsUnique();
-
- b.ToTable("GroupMembers");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("text")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<DateTime?>("ClearedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ClientIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("ClientPublicKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedDecryptionKey")
- .HasColumnType("text");
-
- b.Property<DateTime?>("FulfilledAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("MobileIpAddress")
- .HasColumnType("text");
-
- b.Property<DateTime?>("RetrievedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");
-
- b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");
-
- b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");
-
- b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");
-
- b.HasIndex(new[] { "UserId" }, "IX_UserId");
-
- b.ToTable("MobileLoginRequests");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AppliesToAccountAgeMaxDays")
- .HasColumnType("integer");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("EffectiveFrom")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("EffectiveUntil")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("LimitType")
- .HasColumnType("integer");
-
- b.Property<int>("MaxCount")
- .HasColumnType("integer");
-
- b.Property<string>("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<int?>("Tier")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("WindowSeconds")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("Tier");
-
- b.HasIndex("LimitType", "Enabled");
-
- b.ToTable("RateLimits");
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("time without time zone");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("text");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("boolean");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("time without time zone");
-
- b.Property<int>("Status")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<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.VaultBlobObject", b =>
- {
- b.Property<string>("Hash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("OwnerUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Category")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("LastReferencedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("SizeBytes")
- .HasColumnType("integer");
-
- b.HasKey("Hash", "OwnerUserId");
-
- b.HasIndex("OwnerUserId", "Category");
-
- b.ToTable("VaultBlobObjects");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("BlobHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");
-
- b.ToTable("VaultBlobReferences");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category");
-
- b.ToTable("VaultDataBuckets");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category", "RevisionNumber");
-
- b.ToTable("VaultDataBucketsHistory");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.Property<Guid>("ManifestId")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("OwnerGroupId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId");
-
- b.HasIndex("OwnerGroupId");
-
- b.ToTable("VaultManifests");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedVek")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Metadata")
- .HasColumnType("jsonb");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("VaultManifestId")
- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");
-
- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");
-
- b.ToTable("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("boolean");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("VaultManifestId")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")
- .HasFilter("\"IsPrimary\"");
-
- b.HasIndex("VaultManifestId", "IsPrimary");
-
- b.ToTable("VaultManifestDeliveryKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId", "RevisionNumber");
-
- b.ToTable("VaultManifestsHistory", (string)null);
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("FriendlyName")
- .HasColumnType("text");
-
- b.Property<string>("Xml")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<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>("RoleId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- 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.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("text");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("text");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.Property<string>("RoleId")
- .HasColumnType("text");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (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.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")
- .WithMany("Links")
- .HasForeignKey("EmailClaimId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EmailClaim");
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("DecryptionKeys")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")
- .WithMany("DecryptionKeys")
- .HasForeignKey("VaultManifestDeliveryKeyId")
- .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
-
- b.Navigation("VaultManifestDeliveryKey");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany("Members")
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Group");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("Group");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("OwnerUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")
- .WithMany()
- .HasForeignKey("ManifestId", "Category")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Bucket");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.HasOne("AliasServerDb.Group", "OwnerGroup")
- .WithMany()
- .HasForeignKey("OwnerGroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("OwnerGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("VaultManifestAccessKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
-
- b.Navigation("DecryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Navigation("Links");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Navigation("Members");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Navigation("DecryptionKeys");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260812141816_AddAnonymizedSenderCounts.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810154523_EmailMultiManifestAndStorageV2.Designer.cs
similarity index 99%
rename from apps/server/Databases/AliasServerDb/Migrations/20260812141816_AddAnonymizedSenderCounts.Designer.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20260810154523_EmailMultiManifestAndStorageV2.Designer.cs
index c01b87bc4..51274ed17 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260812141816_AddAnonymizedSenderCounts.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260810154523_EmailMultiManifestAndStorageV2.Designer.cs
@@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace AliasServerDb.Migrations
{
[DbContext(typeof(AliasServerDbContext))]
- [Migration("20260812141816_AddAnonymizedSenderCounts")]
- partial class AddAnonymizedSenderCounts
+ [Migration("20260810154523_EmailMultiManifestAndStorageV2")]
+ partial class EmailMultiManifestAndStorageV2
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -255,8 +255,8 @@ namespace AliasServerDb.Migrations
.HasColumnType("character varying(100)");
b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
b.Property<DateTime>("Timestamp")
.HasColumnType("timestamp with time zone");
@@ -1111,10 +1111,6 @@ namespace AliasServerDb.Migrations
.HasMaxLength(64)
.HasColumnType("character varying(64)");
- b.Property<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
b.Property<Guid>("OwnerGroupId")
.HasColumnType("uuid");
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810154523_AddEmailMultiManifest.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810154523_EmailMultiManifestAndStorageV2.cs
similarity index 55%
rename from apps/server/Databases/AliasServerDb/Migrations/20260810154523_AddEmailMultiManifest.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20260810154523_EmailMultiManifestAndStorageV2.cs
index f0cfe2f4b..d9270c874 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260810154523_AddEmailMultiManifest.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260810154523_EmailMultiManifestAndStorageV2.cs
@@ -1,17 +1,44 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace AliasServerDb.Migrations
{
/// <summary>
- /// Adds a many-to-many relationship between emails and manifests, allowing an email to be claimed by multiple manifests.
+ /// Moves email storage to the multi-manifest model:
+ /// - an alias and a received email are both linked to the manifests that hold them instead of carrying a single
+ /// manifest reference, so one address can be claimed by several manifests at once,
+ /// - the raw message moves to a binary column, is split into separately fetchable parts, and the attachment count
+ /// becomes a column of its own,
+ /// - a group counts the first-time senders of its aliases in an anonymized bucket array.
/// </summary>
- public partial class AddEmailMultiManifest : Migration
+ public partial class EmailMultiManifestAndStorageV2 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ LinkClaimsAndEmailsToManifests(migrationBuilder);
+ MoveMessageSourceToBytes(migrationBuilder);
+ AddDetachedMessageParts(migrationBuilder);
+ AddAnonymizedSenderCounts(migrationBuilder);
+ }
+
+ /// <inheritdoc />
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ RemoveAnonymizedSenderCounts(migrationBuilder);
+ DropDetachedMessageParts(migrationBuilder);
+ RestoreMessageSourceText(migrationBuilder);
+ RestoreSingleManifestLinks(migrationBuilder);
+ }
+
+ /// <summary>
+ /// Replaces the single manifest reference on an alias and on a received email with a link table each.
+ /// </summary>
+ /// <param name="migrationBuilder">Migration builder.</param>
+ private static void LinkClaimsAndEmailsToManifests(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "EmailClaimLinks",
@@ -96,8 +123,163 @@ namespace AliasServerDb.Migrations
migrationBuilder.Sql("""CREATE INDEX "IX_EmailClaimLinks_EmailClaimId_Live" ON "EmailClaimLinks" ("EmailClaimId") WHERE "State" <> 'Removed';""");
}
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
+ /// <summary>
+ /// Moves the raw message to a binary column and gives the attachment count a column of its own.
+ /// </summary>
+ /// <param name="migrationBuilder">Migration builder.</param>
+ private static void MoveMessageSourceToBytes(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AlterColumn<string>(
+ name: "MessageSource",
+ table: "Emails",
+ type: "text",
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "text");
+
+ migrationBuilder.AddColumn<int>(
+ name: "AttachmentCount",
+ table: "Emails",
+ type: "integer",
+ nullable: false,
+ defaultValue: 0);
+
+ // Backfill the count for emails that predate this column from their attachment records, so the column is
+ // authoritative for every row in the table.
+ migrationBuilder.Sql("""
+ UPDATE "Emails" SET "AttachmentCount" = counts."AttachmentCount"
+ FROM (SELECT "EmailId", COUNT(*) AS "AttachmentCount" FROM "EmailAttachments" GROUP BY "EmailId") AS counts
+ WHERE "Emails"."Id" = counts."EmailId";
+ """);
+
+ migrationBuilder.AddColumn<byte[]>(
+ name: "MessageSourceBytes",
+ table: "Emails",
+ type: "bytea",
+ nullable: true);
+
+ // Both columns hold AES ciphertext which is incompressible, so skip TOAST compression.
+ migrationBuilder.Sql("""
+ ALTER TABLE "Emails" ALTER COLUMN "MessageSourceBytes" SET STORAGE EXTERNAL;
+ ALTER TABLE "EmailAttachments" ALTER COLUMN "Bytes" SET STORAGE EXTERNAL;
+ """);
+ }
+
+ /// <summary>
+ /// Adds the table that holds the message body in separately fetchable parts.
+ /// </summary>
+ /// <param name="migrationBuilder">Migration builder.</param>
+ private static void AddDetachedMessageParts(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "EmailParts",
+ columns: table => new
+ {
+ Id = table.Column<int>(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ EmailId = table.Column<int>(type: "integer", nullable: false),
+ PartIndex = table.Column<int>(type: "integer", nullable: false),
+ Bytes = table.Column<byte[]>(type: "bytea", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_EmailParts", x => x.Id);
+ table.ForeignKey(
+ name: "FK_EmailParts_Emails_EmailId",
+ column: x => x.EmailId,
+ principalTable: "Emails",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_EmailParts_EmailId_PartIndex",
+ table: "EmailParts",
+ columns: new[] { "EmailId", "PartIndex" },
+ unique: true);
+
+ // The part bodies are AES ciphertext which is incompressible, so skip TOAST compression.
+ migrationBuilder.Sql(@"ALTER TABLE ""EmailParts"" ALTER COLUMN ""Bytes"" SET STORAGE EXTERNAL;");
+ }
+
+ /// <summary>
+ /// Adds the anonymized first-time sender buckets and the per-alias flag that feeds them.
+ /// </summary>
+ /// <param name="migrationBuilder">Migration builder.</param>
+ private static void AddAnonymizedSenderCounts(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn<int[]>(
+ name: "AnonymizedEmailAliasSenderCounts",
+ table: "Groups",
+ type: "integer[]",
+ nullable: false,
+ defaultValueSql: "array_fill(0, ARRAY[64])");
+
+ migrationBuilder.AddColumn<bool>(
+ name: "AnonymizedSenderCounted",
+ table: "EmailClaims",
+ type: "boolean",
+ nullable: false,
+ defaultValue: false);
+ }
+
+ /// <summary>
+ /// Drops the anonymized first-time sender buckets again.
+ /// </summary>
+ /// <param name="migrationBuilder">Migration builder.</param>
+ private static void RemoveAnonymizedSenderCounts(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "AnonymizedEmailAliasSenderCounts",
+ table: "Groups");
+
+ migrationBuilder.DropColumn(
+ name: "AnonymizedSenderCounted",
+ table: "EmailClaims");
+ }
+
+ /// <summary>
+ /// Drops the detached message parts.
+ /// </summary>
+ /// <param name="migrationBuilder">Migration builder.</param>
+ private static void DropDetachedMessageParts(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "EmailParts");
+ }
+
+ /// <summary>
+ /// Moves the raw message back to the text column and drops the attachment counter.
+ /// </summary>
+ /// <param name="migrationBuilder">Migration builder.</param>
+ private static void RestoreMessageSourceText(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.Sql(@"ALTER TABLE ""EmailAttachments"" ALTER COLUMN ""Bytes"" SET STORAGE EXTENDED;");
+
+ migrationBuilder.DropColumn(
+ name: "AttachmentCount",
+ table: "Emails");
+
+ migrationBuilder.DropColumn(
+ name: "MessageSourceBytes",
+ table: "Emails");
+
+ migrationBuilder.AlterColumn<string>(
+ name: "MessageSource",
+ table: "Emails",
+ type: "text",
+ nullable: false,
+ defaultValue: "",
+ oldClrType: typeof(string),
+ oldType: "text",
+ oldNullable: true);
+ }
+
+ /// <summary>
+ /// Collapses the link tables back into the single manifest reference an alias and an email used to carry.
+ /// </summary>
+ /// <param name="migrationBuilder">Migration builder.</param>
+ private static void RestoreSingleManifestLinks(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("""DROP INDEX IF EXISTS "IX_EmailClaimLinks_EmailClaimId_Live";""");
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810200139_EmailStorageFormatV2.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810200139_EmailStorageFormatV2.Designer.cs
deleted file mode 100644
index 4ff379c94..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260810200139_EmailStorageFormatV2.Designer.cs
+++ /dev/null
@@ -1,1725 +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("20260810200139_EmailStorageFormatV2")]
- partial class EmailStorageFormatV2
- {
- /// <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.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("text");
-
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- 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.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("text");
-
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- 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(100)
- .HasColumnType("character varying(100)");
-
- 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.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<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.ToTable("EmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.Property<Guid>("EmailClaimId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.HasKey("EmailClaimId", "VaultManifestId");
-
- b.HasIndex("VaultManifestId", "EmailClaimId");
-
- b.HasIndex("EmailClaimId")
- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")
- .HasFilter("\"State\" <> 'Removed'");
-
- b.ToTable("EmailClaimLinks");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<Guid>("VaultManifestDeliveryKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("EmailId", "VaultManifestDeliveryKeyId");
-
- b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");
-
- b.ToTable("EmailDecryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailsReceived")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmailAgeDays")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmails")
- .HasColumnType("integer");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("ShadowBlocked")
- .HasColumnType("boolean");
-
- b.Property<DateTime?>("ShadowBlockedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Type")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.ToTable("Groups");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.HasIndex("GroupId", "UserId")
- .IsUnique();
-
- b.ToTable("GroupMembers");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("text")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<DateTime?>("ClearedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ClientIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("ClientPublicKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedDecryptionKey")
- .HasColumnType("text");
-
- b.Property<DateTime?>("FulfilledAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("MobileIpAddress")
- .HasColumnType("text");
-
- b.Property<DateTime?>("RetrievedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");
-
- b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");
-
- b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");
-
- b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");
-
- b.HasIndex(new[] { "UserId" }, "IX_UserId");
-
- b.ToTable("MobileLoginRequests");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AppliesToAccountAgeMaxDays")
- .HasColumnType("integer");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("EffectiveFrom")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("EffectiveUntil")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("LimitType")
- .HasColumnType("integer");
-
- b.Property<int>("MaxCount")
- .HasColumnType("integer");
-
- b.Property<string>("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<int?>("Tier")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("WindowSeconds")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("Tier");
-
- b.HasIndex("LimitType", "Enabled");
-
- b.ToTable("RateLimits");
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("time without time zone");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("text");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("boolean");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("time without time zone");
-
- b.Property<int>("Status")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<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.VaultBlobObject", b =>
- {
- b.Property<string>("Hash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("OwnerUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Category")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("LastReferencedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("SizeBytes")
- .HasColumnType("integer");
-
- b.HasKey("Hash", "OwnerUserId");
-
- b.HasIndex("OwnerUserId", "Category");
-
- b.ToTable("VaultBlobObjects");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("BlobHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");
-
- b.ToTable("VaultBlobReferences");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category");
-
- b.ToTable("VaultDataBuckets");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category", "RevisionNumber");
-
- b.ToTable("VaultDataBucketsHistory");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.Property<Guid>("ManifestId")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("OwnerGroupId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId");
-
- b.HasIndex("OwnerGroupId");
-
- b.ToTable("VaultManifests");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedVek")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Metadata")
- .HasColumnType("jsonb");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("VaultManifestId")
- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");
-
- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");
-
- b.ToTable("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("boolean");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("VaultManifestId")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")
- .HasFilter("\"IsPrimary\"");
-
- b.HasIndex("VaultManifestId", "IsPrimary");
-
- b.ToTable("VaultManifestDeliveryKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId", "RevisionNumber");
-
- b.ToTable("VaultManifestsHistory", (string)null);
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("FriendlyName")
- .HasColumnType("text");
-
- b.Property<string>("Xml")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<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>("RoleId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- 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.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("text");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("text");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.Property<string>("RoleId")
- .HasColumnType("text");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (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.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")
- .WithMany("Links")
- .HasForeignKey("EmailClaimId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EmailClaim");
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("DecryptionKeys")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")
- .WithMany("DecryptionKeys")
- .HasForeignKey("VaultManifestDeliveryKeyId")
- .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
-
- b.Navigation("VaultManifestDeliveryKey");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany("Members")
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Group");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("Group");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("OwnerUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")
- .WithMany()
- .HasForeignKey("ManifestId", "Category")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Bucket");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.HasOne("AliasServerDb.Group", "OwnerGroup")
- .WithMany()
- .HasForeignKey("OwnerGroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("OwnerGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("VaultManifestAccessKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
-
- b.Navigation("DecryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Navigation("Links");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Navigation("Members");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Navigation("DecryptionKeys");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810200139_EmailStorageFormatV2.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810200139_EmailStorageFormatV2.cs
deleted file mode 100644
index 99068b2a8..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260810200139_EmailStorageFormatV2.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations
-{
- /// <inheritdoc />
- public partial class EmailStorageFormatV2 : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AlterColumn<string>(
- name: "MessageSource",
- table: "Emails",
- type: "text",
- nullable: true,
- oldClrType: typeof(string),
- oldType: "text");
-
- migrationBuilder.AddColumn<int>(
- name: "AttachmentCount",
- table: "Emails",
- type: "integer",
- nullable: false,
- defaultValue: 0);
-
- // Backfill the count for emails that predate this column from their attachment records, so the column is
- // authoritative for every row in the table.
- migrationBuilder.Sql("""
- UPDATE "Emails" SET "AttachmentCount" = counts."AttachmentCount"
- FROM (SELECT "EmailId", COUNT(*) AS "AttachmentCount" FROM "EmailAttachments" GROUP BY "EmailId") AS counts
- WHERE "Emails"."Id" = counts."EmailId";
- """);
-
- migrationBuilder.AddColumn<byte[]>(
- name: "MessageSourceBytes",
- table: "Emails",
- type: "bytea",
- nullable: true);
-
- // Both columns hold AES ciphertext which is incompressible, so skip TOAST compression.
- migrationBuilder.Sql("""
- ALTER TABLE "Emails" ALTER COLUMN "MessageSourceBytes" SET STORAGE EXTERNAL;
- ALTER TABLE "EmailAttachments" ALTER COLUMN "Bytes" SET STORAGE EXTERNAL;
- """);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.Sql(@"ALTER TABLE ""EmailAttachments"" ALTER COLUMN ""Bytes"" SET STORAGE EXTENDED;");
-
- migrationBuilder.DropColumn(
- name: "AttachmentCount",
- table: "Emails");
-
- migrationBuilder.DropColumn(
- name: "MessageSourceBytes",
- table: "Emails");
-
- migrationBuilder.AlterColumn<string>(
- name: "MessageSource",
- table: "Emails",
- type: "text",
- nullable: false,
- defaultValue: "",
- oldClrType: typeof(string),
- oldType: "text",
- oldNullable: true);
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260811195539_EmailDetachedParts.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260811195539_EmailDetachedParts.Designer.cs
deleted file mode 100644
index a9aaece6f..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260811195539_EmailDetachedParts.Designer.cs
+++ /dev/null
@@ -1,1672 +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("20260811195539_EmailDetachedParts")]
- partial class EmailDetachedParts
- {
- /// <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(100)
- .HasColumnType("character varying(100)");
-
- 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.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<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.ToTable("EmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.Property<Guid>("EmailClaimId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.HasKey("EmailClaimId", "VaultManifestId");
-
- b.HasIndex("VaultManifestId", "EmailClaimId");
-
- b.HasIndex("EmailClaimId")
- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")
- .HasFilter("\"State\" <> 'Removed'");
-
- b.ToTable("EmailClaimLinks");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<Guid>("VaultManifestDeliveryKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("EmailId", "VaultManifestDeliveryKeyId");
-
- b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");
-
- b.ToTable("EmailDecryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailPart", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<int>("PartIndex")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId", "PartIndex")
- .IsUnique();
-
- b.ToTable("EmailParts");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailsReceived")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmailAgeDays")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmails")
- .HasColumnType("integer");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("ShadowBlocked")
- .HasColumnType("boolean");
-
- b.Property<DateTime?>("ShadowBlockedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Type")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.ToTable("Groups");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.HasIndex("GroupId", "UserId")
- .IsUnique();
-
- b.ToTable("GroupMembers");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("text")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<DateTime?>("ClearedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ClientIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("ClientPublicKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedDecryptionKey")
- .HasColumnType("text");
-
- b.Property<DateTime?>("FulfilledAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("MobileIpAddress")
- .HasColumnType("text");
-
- b.Property<DateTime?>("RetrievedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");
-
- b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");
-
- b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");
-
- b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");
-
- b.HasIndex(new[] { "UserId" }, "IX_UserId");
-
- b.ToTable("MobileLoginRequests");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AppliesToAccountAgeMaxDays")
- .HasColumnType("integer");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("EffectiveFrom")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("EffectiveUntil")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("LimitType")
- .HasColumnType("integer");
-
- b.Property<int>("MaxCount")
- .HasColumnType("integer");
-
- b.Property<string>("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<int?>("Tier")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("WindowSeconds")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("Tier");
-
- b.HasIndex("LimitType", "Enabled");
-
- b.ToTable("RateLimits");
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("time without time zone");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("text");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("boolean");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("time without time zone");
-
- b.Property<int>("Status")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<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.VaultBlobObject", b =>
- {
- b.Property<string>("Hash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("OwnerUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Category")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("LastReferencedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("SizeBytes")
- .HasColumnType("integer");
-
- b.HasKey("Hash", "OwnerUserId");
-
- b.HasIndex("OwnerUserId", "Category");
-
- b.ToTable("VaultBlobObjects");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("BlobHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");
-
- b.ToTable("VaultBlobReferences");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category");
-
- b.ToTable("VaultDataBuckets");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category", "RevisionNumber");
-
- b.ToTable("VaultDataBucketsHistory");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.Property<Guid>("ManifestId")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("OwnerGroupId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId");
-
- b.HasIndex("OwnerGroupId");
-
- b.ToTable("VaultManifests");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedVek")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Metadata")
- .HasColumnType("jsonb");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("VaultManifestId")
- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");
-
- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");
-
- b.ToTable("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("boolean");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("VaultManifestId")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")
- .HasFilter("\"IsPrimary\"");
-
- b.HasIndex("VaultManifestId", "IsPrimary");
-
- b.ToTable("VaultManifestDeliveryKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId", "RevisionNumber");
-
- b.ToTable("VaultManifestsHistory", (string)null);
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("FriendlyName")
- .HasColumnType("text");
-
- b.Property<string>("Xml")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("ClaimType")
- .HasColumnType("text");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("text");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
-
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.HasOne("AliasServerDb.Group", "PersonalGroup")
- .WithOne()
- .HasForeignKey("AliasServerDb.AliasVaultUser", "PersonalGroupId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
-
- b.Navigation("PersonalGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")
- .WithMany("Links")
- .HasForeignKey("EmailClaimId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EmailClaim");
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("DecryptionKeys")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")
- .WithMany("DecryptionKeys")
- .HasForeignKey("VaultManifestDeliveryKeyId")
- .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- 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.GroupMember", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany("Members")
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Group");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("Group");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("OwnerUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")
- .WithMany()
- .HasForeignKey("ManifestId", "Category")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Bucket");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.HasOne("AliasServerDb.Group", "OwnerGroup")
- .WithMany()
- .HasForeignKey("OwnerGroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("OwnerGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("VaultManifestAccessKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
-
- b.Navigation("Parts");
-
- b.Navigation("DecryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Navigation("Links");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Navigation("Members");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Navigation("DecryptionKeys");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260811195539_EmailDetachedParts.cs b/apps/server/Databases/AliasServerDb/Migrations/20260811195539_EmailDetachedParts.cs
deleted file mode 100644
index c74b6c0e1..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260811195539_EmailDetachedParts.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations
-{
- /// <inheritdoc />
- public partial class EmailDetachedParts : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "EmailParts",
- columns: table => new
- {
- Id = table.Column<int>(type: "integer", nullable: false)
- .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
- EmailId = table.Column<int>(type: "integer", nullable: false),
- PartIndex = table.Column<int>(type: "integer", nullable: false),
- Bytes = table.Column<byte[]>(type: "bytea", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_EmailParts", x => x.Id);
- table.ForeignKey(
- name: "FK_EmailParts_Emails_EmailId",
- column: x => x.EmailId,
- principalTable: "Emails",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_EmailParts_EmailId_PartIndex",
- table: "EmailParts",
- columns: new[] { "EmailId", "PartIndex" },
- unique: true);
-
- // The part bodies are AES ciphertext which is incompressible, so skip TOAST compression.
- migrationBuilder.Sql(@"ALTER TABLE ""EmailParts"" ALTER COLUMN ""Bytes"" SET STORAGE EXTERNAL;");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "EmailParts");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260812141816_AddAnonymizedSenderCounts.cs b/apps/server/Databases/AliasServerDb/Migrations/20260812141816_AddAnonymizedSenderCounts.cs
deleted file mode 100644
index cde5299de..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260812141816_AddAnonymizedSenderCounts.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations
-{
- /// <inheritdoc />
- public partial class AddAnonymizedSenderCounts : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<int[]>(
- name: "AnonymizedEmailAliasSenderCounts",
- table: "Groups",
- type: "integer[]",
- nullable: false,
- defaultValueSql: "array_fill(0, ARRAY[64])");
-
- migrationBuilder.AddColumn<bool>(
- name: "AnonymizedSenderCounted",
- table: "EmailClaims",
- type: "boolean",
- nullable: false,
- defaultValue: false);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "AnonymizedEmailAliasSenderCounts",
- table: "Groups");
-
- migrationBuilder.DropColumn(
- name: "AnonymizedSenderCounted",
- table: "EmailClaims");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.Designer.cs
index 62852b794..971bc6896 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.Designer.cs
@@ -255,8 +255,8 @@ namespace AliasServerDb.Migrations
.HasColumnType("character varying(100)");
b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
+ .HasMaxLength(255)
+ .HasColumnType("character varying(255)");
b.Property<DateTime>("Timestamp")
.HasColumnType("timestamp with time zone");
@@ -1111,10 +1111,6 @@ namespace AliasServerDb.Migrations
.HasMaxLength(64)
.HasColumnType("character varying(64)");
- b.Property<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
b.Property<Guid>("OwnerGroupId")
.HasColumnType("uuid");
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.cs b/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.cs
index 7d19cc1c5..5292a0cac 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260817222545_ReorderTableColumns.cs
@@ -5,7 +5,9 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace AliasServerDb.Migrations
{
/// <summary>
- /// Reorders the physical columns of the tables.
+ /// Reorders the physical columns of the tables that predate the manifest storage model, whose columns were added
+ /// and dropped in the order the schema happened to grow. The tables the earlier migrations create are already
+ /// created in their final order, so they are left alone here.
/// </summary>
public partial class ReorderTableColumns : Migration
{
@@ -20,14 +22,7 @@ namespace AliasServerDb.Migrations
RebuildEmailClaims(migrationBuilder);
RebuildRateLimits(migrationBuilder);
RebuildVaultManifests(migrationBuilder);
- RebuildVaultManifestsHistory(migrationBuilder);
RebuildVaultManifestDeliveryKeys(migrationBuilder);
- RebuildVaultManifestAccessKeys(migrationBuilder);
- RebuildVaultDataBuckets(migrationBuilder);
- RebuildVaultDataBucketsHistory(migrationBuilder);
- RebuildVaultBlobObjects(migrationBuilder);
- RebuildUserGrantKeys(migrationBuilder);
- RebuildUserUnlockKeys(migrationBuilder);
RecreateForeignKeys(migrationBuilder);
}
@@ -68,9 +63,7 @@ namespace AliasServerDb.Migrations
ALTER TABLE "VaultBlobObjects" DROP CONSTRAINT "FK_VaultBlobObjects_AliasVaultUsers_OwnerUserId";
ALTER TABLE "VaultBlobReferences" DROP CONSTRAINT "FK_VaultBlobReferences_VaultManifests_ManifestId";
ALTER TABLE "VaultDataBuckets" DROP CONSTRAINT "FK_VaultDataBuckets_VaultManifests_ManifestId";
- ALTER TABLE "VaultDataBucketsHistory" DROP CONSTRAINT "FK_VaultDataBucketsHistory_VaultDataBuckets_ManifestId_Category";
ALTER TABLE "VaultManifestAccessKeys" DROP CONSTRAINT "FK_VaultManifestAccessKeys_AliasVaultUsers_UserId";
- ALTER TABLE "VaultManifestAccessKeys" DROP CONSTRAINT "FK_VaultManifestAccessKeys_UserGrantKeys_UserGrantKeyId";
ALTER TABLE "VaultManifestDeliveryKeys" DROP CONSTRAINT "FK_VaultManifestDeliveryKeys_VaultManifests_VaultManifestId";
ALTER TABLE "VaultManifests" DROP CONSTRAINT "FK_VaultManifests_Groups_OwnerGroupId";
ALTER TABLE "VaultManifestsHistory" DROP CONSTRAINT "FK_VaultManifestsHistory_VaultManifests_ManifestId";
@@ -287,7 +280,6 @@ namespace AliasServerDb.Migrations
CREATE TABLE "VaultManifests_reordered" (
"ManifestId" uuid NOT NULL,
"OwnerGroupId" uuid NOT NULL,
- "Name" character varying(255),
"StorageFormat" character varying(20) NOT NULL,
"ManifestBlob" bytea,
"ManifestCiphertextHash" character varying(64),
@@ -309,8 +301,8 @@ namespace AliasServerDb.Migrations
ALTER TABLE "VaultManifests_reordered" ALTER COLUMN "ManifestBlob" SET STORAGE EXTERNAL;
- INSERT INTO "VaultManifests_reordered" ("ManifestId", "OwnerGroupId", "Name", "StorageFormat", "ManifestBlob", "ManifestCiphertextHash", "KeyVersion", "RevisionNumber", "FileSize", "CredentialsCount", "EmailClaimsCount", "Client", "CreatedAt", "UpdatedAt", "VaultBlob", "Version", "Salt", "Verifier", "EncryptionType", "EncryptionSettings")
- SELECT "ManifestId", "OwnerGroupId", "Name", "StorageFormat", "ManifestBlob", "ManifestCiphertextHash", "KeyVersion", "RevisionNumber", "FileSize", "CredentialsCount", "EmailClaimsCount", "Client", "CreatedAt", "UpdatedAt", "VaultBlob", "Version", "Salt", "Verifier", "EncryptionType", "EncryptionSettings"
+ INSERT INTO "VaultManifests_reordered" ("ManifestId", "OwnerGroupId", "StorageFormat", "ManifestBlob", "ManifestCiphertextHash", "KeyVersion", "RevisionNumber", "FileSize", "CredentialsCount", "EmailClaimsCount", "Client", "CreatedAt", "UpdatedAt", "VaultBlob", "Version", "Salt", "Verifier", "EncryptionType", "EncryptionSettings")
+ SELECT "ManifestId", "OwnerGroupId", "StorageFormat", "ManifestBlob", "ManifestCiphertextHash", "KeyVersion", "RevisionNumber", "FileSize", "CredentialsCount", "EmailClaimsCount", "Client", "CreatedAt", "UpdatedAt", "VaultBlob", "Version", "Salt", "Verifier", "EncryptionType", "EncryptionSettings"
FROM "VaultManifests";
DROP TABLE "VaultManifests";
@@ -321,48 +313,6 @@ namespace AliasServerDb.Migrations
""");
}
- /// <summary>
- /// Mirrors the column order of the VaultManifests head table, with the revision number directly behind the
- /// manifest id because the two together identify a history row.
- /// </summary>
- /// <param name="migrationBuilder">Migration builder.</param>
- private static void RebuildVaultManifestsHistory(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.Sql("""
- CREATE TABLE "VaultManifestsHistory_reordered" (
- "ManifestId" uuid NOT NULL,
- "RevisionNumber" bigint NOT NULL,
- "StorageFormat" character varying(20) NOT NULL,
- "ManifestBlob" bytea,
- "ManifestCiphertextHash" character varying(64),
- "KeyVersion" integer DEFAULT 0 NOT NULL,
- "FileSize" integer NOT NULL,
- "CredentialsCount" integer NOT NULL,
- "EmailClaimsCount" integer NOT NULL,
- "Client" character varying(255),
- "CreatedAt" timestamp with time zone NOT NULL,
- "UpdatedAt" timestamp with time zone NOT NULL,
- "VaultBlob" text,
- "Version" character varying(255),
- "Salt" character varying(100),
- "Verifier" character varying(1000),
- "EncryptionType" text,
- "EncryptionSettings" text
- );
-
- ALTER TABLE "VaultManifestsHistory_reordered" ALTER COLUMN "ManifestBlob" SET STORAGE EXTERNAL;
-
- INSERT INTO "VaultManifestsHistory_reordered" ("ManifestId", "RevisionNumber", "StorageFormat", "ManifestBlob", "ManifestCiphertextHash", "KeyVersion", "FileSize", "CredentialsCount", "EmailClaimsCount", "Client", "CreatedAt", "UpdatedAt", "VaultBlob", "Version", "Salt", "Verifier", "EncryptionType", "EncryptionSettings")
- SELECT "ManifestId", "RevisionNumber", "StorageFormat", "ManifestBlob", "ManifestCiphertextHash", "KeyVersion", "FileSize", "CredentialsCount", "EmailClaimsCount", "Client", "CreatedAt", "UpdatedAt", "VaultBlob", "Version", "Salt", "Verifier", "EncryptionType", "EncryptionSettings"
- FROM "VaultManifestsHistory";
-
- DROP TABLE "VaultManifestsHistory";
- ALTER TABLE "VaultManifestsHistory_reordered" RENAME TO "VaultManifestsHistory";
-
- ALTER TABLE "VaultManifestsHistory" ADD CONSTRAINT "PK_VaultManifestsHistory" PRIMARY KEY ("ManifestId", "RevisionNumber");
- """);
- }
-
/// <summary>
/// Moves the manifest a delivery key belongs to up to the second column instead of leaving it behind the
/// timestamps.
@@ -393,204 +343,6 @@ namespace AliasServerDb.Migrations
""");
}
- /// <summary>
- /// Puts the version of the VEK next to the wrapped VEK it describes, and the account key version next to the
- /// grant key it belongs to, instead of both trailing the timestamps.
- /// </summary>
- /// <param name="migrationBuilder">Migration builder.</param>
- private static void RebuildVaultManifestAccessKeys(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.Sql("""
- CREATE TABLE "VaultManifestAccessKeys_reordered" (
- "Id" uuid NOT NULL,
- "UserId" character varying(255) NOT NULL,
- "VaultManifestId" uuid NOT NULL,
- "Type" character varying(30) NOT NULL,
- "Algorithm" character varying(30) NOT NULL,
- "EncryptedVek" text NOT NULL,
- "KeyVersion" integer DEFAULT 0 NOT NULL,
- "UserGrantKeyId" uuid,
- "AccountKeyVersion" integer,
- "Metadata" jsonb,
- "CreatedAt" timestamp with time zone NOT NULL,
- "UpdatedAt" timestamp with time zone NOT NULL,
- "LastUsedAt" timestamp with time zone
- );
-
- INSERT INTO "VaultManifestAccessKeys_reordered" ("Id", "UserId", "VaultManifestId", "Type", "Algorithm", "EncryptedVek", "KeyVersion", "UserGrantKeyId", "AccountKeyVersion", "Metadata", "CreatedAt", "UpdatedAt", "LastUsedAt")
- SELECT "Id", "UserId", "VaultManifestId", "Type", "Algorithm", "EncryptedVek", "KeyVersion", "UserGrantKeyId", "AccountKeyVersion", "Metadata", "CreatedAt", "UpdatedAt", "LastUsedAt"
- FROM "VaultManifestAccessKeys";
-
- DROP TABLE "VaultManifestAccessKeys";
- ALTER TABLE "VaultManifestAccessKeys_reordered" RENAME TO "VaultManifestAccessKeys";
-
- ALTER TABLE "VaultManifestAccessKeys" ADD CONSTRAINT "PK_VaultManifestAccessKeys" PRIMARY KEY ("Id");
- CREATE INDEX "IX_VaultManifestAccessKeys_UserGrantKeyId" ON "VaultManifestAccessKeys" ("UserGrantKeyId");
- CREATE INDEX "IX_VaultManifestAccessKeys_VaultManifestId" ON "VaultManifestAccessKeys" ("VaultManifestId");
- CREATE UNIQUE INDEX "UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version" ON "VaultManifestAccessKeys" ("UserId", "Type", "VaultManifestId", "KeyVersion");
- """);
- }
-
- /// <summary>
- /// Leads with the composite key, then the revision the bucket is at, and keeps the ciphertext together with
- /// its hash and key version before the timestamps.
- /// </summary>
- /// <param name="migrationBuilder">Migration builder.</param>
- private static void RebuildVaultDataBuckets(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.Sql("""
- CREATE TABLE "VaultDataBuckets_reordered" (
- "ManifestId" uuid NOT NULL,
- "Category" character varying(50) NOT NULL,
- "RevisionNumber" bigint NOT NULL,
- "EncryptedData" bytea NOT NULL,
- "CiphertextHash" character varying(64),
- "KeyVersion" integer DEFAULT 0 NOT NULL,
- "CreatedAt" timestamp with time zone NOT NULL,
- "UpdatedAt" timestamp with time zone NOT NULL
- );
-
- ALTER TABLE "VaultDataBuckets_reordered" ALTER COLUMN "EncryptedData" SET STORAGE EXTERNAL;
-
- INSERT INTO "VaultDataBuckets_reordered" ("ManifestId", "Category", "RevisionNumber", "EncryptedData", "CiphertextHash", "KeyVersion", "CreatedAt", "UpdatedAt")
- SELECT "ManifestId", "Category", "RevisionNumber", "EncryptedData", "CiphertextHash", "KeyVersion", "CreatedAt", "UpdatedAt"
- FROM "VaultDataBuckets";
-
- DROP TABLE "VaultDataBuckets";
- ALTER TABLE "VaultDataBuckets_reordered" RENAME TO "VaultDataBuckets";
-
- ALTER TABLE "VaultDataBuckets" ADD CONSTRAINT "PK_VaultDataBuckets" PRIMARY KEY ("ManifestId", "Category");
- """);
- }
-
- /// <summary>
- /// Mirrors the column order of the VaultDataBuckets head table, which also puts the columns in the same order
- /// as the composite primary key of the history table.
- /// </summary>
- /// <param name="migrationBuilder">Migration builder.</param>
- private static void RebuildVaultDataBucketsHistory(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.Sql("""
- CREATE TABLE "VaultDataBucketsHistory_reordered" (
- "ManifestId" uuid NOT NULL,
- "Category" character varying(50) NOT NULL,
- "RevisionNumber" bigint NOT NULL,
- "EncryptedData" bytea NOT NULL,
- "CiphertextHash" character varying(64),
- "KeyVersion" integer DEFAULT 0 NOT NULL,
- "CreatedAt" timestamp with time zone NOT NULL,
- "UpdatedAt" timestamp with time zone NOT NULL
- );
-
- ALTER TABLE "VaultDataBucketsHistory_reordered" ALTER COLUMN "EncryptedData" SET STORAGE EXTERNAL;
-
- INSERT INTO "VaultDataBucketsHistory_reordered" ("ManifestId", "Category", "RevisionNumber", "EncryptedData", "CiphertextHash", "KeyVersion", "CreatedAt", "UpdatedAt")
- SELECT "ManifestId", "Category", "RevisionNumber", "EncryptedData", "CiphertextHash", "KeyVersion", "CreatedAt", "UpdatedAt"
- FROM "VaultDataBucketsHistory";
-
- DROP TABLE "VaultDataBucketsHistory";
- ALTER TABLE "VaultDataBucketsHistory_reordered" RENAME TO "VaultDataBucketsHistory";
-
- ALTER TABLE "VaultDataBucketsHistory" ADD CONSTRAINT "PK_VaultDataBucketsHistory" PRIMARY KEY ("ManifestId", "Category", "RevisionNumber");
- """);
- }
-
- /// <summary>
- /// Moves the key version next to the ciphertext it applies to, leaving the timestamps at the end.
- /// </summary>
- /// <param name="migrationBuilder">Migration builder.</param>
- private static void RebuildVaultBlobObjects(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.Sql("""
- CREATE TABLE "VaultBlobObjects_reordered" (
- "Hash" character varying(64) NOT NULL,
- "OwnerUserId" character varying(255) NOT NULL,
- "Category" character varying(20) NOT NULL,
- "EncryptedData" bytea NOT NULL,
- "SizeBytes" integer NOT NULL,
- "KeyVersion" integer DEFAULT 0 NOT NULL,
- "CreatedAt" timestamp with time zone NOT NULL,
- "LastReferencedAt" timestamp with time zone NOT NULL
- );
-
- ALTER TABLE "VaultBlobObjects_reordered" ALTER COLUMN "EncryptedData" SET STORAGE EXTERNAL;
-
- INSERT INTO "VaultBlobObjects_reordered" ("Hash", "OwnerUserId", "Category", "EncryptedData", "SizeBytes", "KeyVersion", "CreatedAt", "LastReferencedAt")
- SELECT "Hash", "OwnerUserId", "Category", "EncryptedData", "SizeBytes", "KeyVersion", "CreatedAt", "LastReferencedAt"
- FROM "VaultBlobObjects";
-
- DROP TABLE "VaultBlobObjects";
- ALTER TABLE "VaultBlobObjects_reordered" RENAME TO "VaultBlobObjects";
-
- ALTER TABLE "VaultBlobObjects" ADD CONSTRAINT "PK_VaultBlobObjects" PRIMARY KEY ("Hash", "OwnerUserId");
- CREATE INDEX "IX_VaultBlobObjects_OwnerUserId_Category" ON "VaultBlobObjects" ("OwnerUserId", "Category");
- """);
- }
-
- /// <summary>
- /// Moves the account key version next to the key material it applies to instead of behind the timestamps.
- /// </summary>
- /// <param name="migrationBuilder">Migration builder.</param>
- private static void RebuildUserGrantKeys(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.Sql("""
- CREATE TABLE "UserGrantKeys_reordered" (
- "Id" uuid NOT NULL,
- "UserId" character varying(255) NOT NULL,
- "PublicKey" character varying(2000) NOT NULL,
- "EncryptedPrivateKey" character varying(4000) NOT NULL,
- "AccountKeyVersion" integer DEFAULT 0 NOT NULL,
- "IsPrimary" boolean NOT NULL,
- "CreatedAt" timestamp with time zone NOT NULL,
- "UpdatedAt" timestamp with time zone NOT NULL
- );
-
- INSERT INTO "UserGrantKeys_reordered" ("Id", "UserId", "PublicKey", "EncryptedPrivateKey", "AccountKeyVersion", "IsPrimary", "CreatedAt", "UpdatedAt")
- SELECT "Id", "UserId", "PublicKey", "EncryptedPrivateKey", "AccountKeyVersion", "IsPrimary", "CreatedAt", "UpdatedAt"
- FROM "UserGrantKeys";
-
- DROP TABLE "UserGrantKeys";
- ALTER TABLE "UserGrantKeys_reordered" RENAME TO "UserGrantKeys";
-
- ALTER TABLE "UserGrantKeys" ADD CONSTRAINT "PK_UserGrantKeys" PRIMARY KEY ("Id");
- CREATE UNIQUE INDEX "UX_UserGrantKeys_User_Primary" ON "UserGrantKeys" ("UserId") WHERE "IsPrimary";
- """);
- }
-
- /// <summary>
- /// Moves the label up next to the type it names, and the account key version next to the account key it
- /// applies to, matching the order of the unique index on the table.
- /// </summary>
- /// <param name="migrationBuilder">Migration builder.</param>
- private static void RebuildUserUnlockKeys(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.Sql("""
- CREATE TABLE "UserUnlockKeys_reordered" (
- "Id" uuid NOT NULL,
- "UserId" character varying(255) NOT NULL,
- "Type" character varying(30) NOT NULL,
- "Label" character varying(100) DEFAULT ''::character varying NOT NULL,
- "Algorithm" character varying(30) NOT NULL,
- "EncryptedAccountKey" text NOT NULL,
- "AccountKeyVersion" integer DEFAULT 0 NOT NULL,
- "Metadata" jsonb,
- "CreatedAt" timestamp with time zone NOT NULL,
- "UpdatedAt" timestamp with time zone NOT NULL,
- "LastUsedAt" timestamp with time zone
- );
-
- INSERT INTO "UserUnlockKeys_reordered" ("Id", "UserId", "Type", "Label", "Algorithm", "EncryptedAccountKey", "AccountKeyVersion", "Metadata", "CreatedAt", "UpdatedAt", "LastUsedAt")
- SELECT "Id", "UserId", "Type", "Label", "Algorithm", "EncryptedAccountKey", "AccountKeyVersion", "Metadata", "CreatedAt", "UpdatedAt", "LastUsedAt"
- FROM "UserUnlockKeys";
-
- DROP TABLE "UserUnlockKeys";
- ALTER TABLE "UserUnlockKeys_reordered" RENAME TO "UserUnlockKeys";
-
- ALTER TABLE "UserUnlockKeys" ADD CONSTRAINT "PK_UserUnlockKeys" PRIMARY KEY ("Id");
- CREATE UNIQUE INDEX "UX_UserUnlockKeys_UserId_Type_Label" ON "UserUnlockKeys" ("UserId", "Type", "Label");
- """);
- }
-
/// <summary>
/// Recreates every foreign key that was dropped up front, with the same names and delete behaviour as before.
/// </summary>
@@ -615,9 +367,7 @@ namespace AliasServerDb.Migrations
ALTER TABLE "VaultBlobObjects" ADD CONSTRAINT "FK_VaultBlobObjects_AliasVaultUsers_OwnerUserId" FOREIGN KEY ("OwnerUserId") REFERENCES "AliasVaultUsers"("Id") ON DELETE CASCADE;
ALTER TABLE "VaultBlobReferences" ADD CONSTRAINT "FK_VaultBlobReferences_VaultManifests_ManifestId" FOREIGN KEY ("ManifestId") REFERENCES "VaultManifests"("ManifestId") ON DELETE CASCADE;
ALTER TABLE "VaultDataBuckets" ADD CONSTRAINT "FK_VaultDataBuckets_VaultManifests_ManifestId" FOREIGN KEY ("ManifestId") REFERENCES "VaultManifests"("ManifestId") ON DELETE CASCADE;
- ALTER TABLE "VaultDataBucketsHistory" ADD CONSTRAINT "FK_VaultDataBucketsHistory_VaultDataBuckets_ManifestId_Category" FOREIGN KEY ("ManifestId", "Category") REFERENCES "VaultDataBuckets"("ManifestId", "Category") ON DELETE CASCADE;
ALTER TABLE "VaultManifestAccessKeys" ADD CONSTRAINT "FK_VaultManifestAccessKeys_AliasVaultUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AliasVaultUsers"("Id") ON DELETE CASCADE;
- ALTER TABLE "VaultManifestAccessKeys" ADD CONSTRAINT "FK_VaultManifestAccessKeys_UserGrantKeys_UserGrantKeyId" FOREIGN KEY ("UserGrantKeyId") REFERENCES "UserGrantKeys"("Id") ON DELETE SET NULL;
ALTER TABLE "VaultManifestDeliveryKeys" ADD CONSTRAINT "FK_VaultManifestDeliveryKeys_VaultManifests_VaultManifestId" FOREIGN KEY ("VaultManifestId") REFERENCES "VaultManifests"("ManifestId") ON DELETE CASCADE;
ALTER TABLE "VaultManifests" ADD CONSTRAINT "FK_VaultManifests_Groups_OwnerGroupId" FOREIGN KEY ("OwnerGroupId") REFERENCES "Groups"("Id") ON DELETE CASCADE;
ALTER TABLE "VaultManifestsHistory" ADD CONSTRAINT "FK_VaultManifestsHistory_VaultManifests_ManifestId" FOREIGN KEY ("ManifestId") REFERENCES "VaultManifests"("ManifestId") ON DELETE CASCADE;
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsAndClientActions.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsAndClientActions.Designer.cs
deleted file mode 100644
index b49a87172..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsAndClientActions.Designer.cs
+++ /dev/null
@@ -1,1837 +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("20260820120455_AddGroupInvitationsAndClientActions")]
- partial class AddGroupInvitationsAndClientActions
- {
- /// <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(100)
- .HasColumnType("character varying(100)");
-
- 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.ClientAction", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Payload")
- .HasColumnType("jsonb");
-
- b.Property<Guid?>("TargetGroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("TargetUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("TargetGroupId");
-
- b.HasIndex("TargetUserId");
-
- b.ToTable("ClientActions");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<int>("AttachmentCount")
- .HasColumnType("integer");
-
- b.Property<DateTime>("Date")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("text");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("text");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("text");
-
- b.Property<string>("MessageSource")
- .HasColumnType("text");
-
- b.Property<byte[]>("MessageSourceBytes")
- .HasColumnType("bytea");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("boolean");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<bool>("Visible")
- .HasColumnType("boolean");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("Visible");
-
- b.HasIndex("To", "DateSystem");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<DateTime>("Date")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("Filesize")
- .HasColumnType("integer");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("AnonymizedSenderCounted")
- .HasColumnType("boolean");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.ToTable("EmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.Property<Guid>("EmailClaimId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.HasKey("EmailClaimId", "VaultManifestId");
-
- b.HasIndex("EmailClaimId")
- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")
- .HasFilter("\"State\" <> 'Removed'");
-
- b.HasIndex("VaultManifestId", "EmailClaimId");
-
- b.ToTable("EmailClaimLinks");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<Guid>("VaultManifestDeliveryKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("EmailId", "VaultManifestDeliveryKeyId");
-
- b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");
-
- b.ToTable("EmailDecryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailPart", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<int>("PartIndex")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId", "PartIndex")
- .IsUnique();
-
- b.ToTable("EmailParts");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.PrimitiveCollection<int[]>("AnonymizedEmailAliasSenderCounts")
- .IsRequired()
- .ValueGeneratedOnAdd()
- .HasColumnType("integer[]")
- .HasDefaultValueSql("array_fill(0, ARRAY[64])");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailsReceived")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmailAgeDays")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmails")
- .HasColumnType("integer");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("ShadowBlocked")
- .HasColumnType("boolean");
-
- b.Property<DateTime?>("ShadowBlockedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Type")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.ToTable("Groups");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedVek")
- .HasColumnType("text");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("InviteeUserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("InviterUserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("RespondedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<Guid?>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("InviterUserId");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("GroupId", "InviteeUserId")
- .IsUnique()
- .HasDatabaseName("UX_GroupInvitations_Group_Invitee_Pending")
- .HasFilter("\"State\" = 'Pending'");
-
- b.HasIndex("InviteeUserId", "State");
-
- b.ToTable("GroupInvitations");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.HasIndex("GroupId", "UserId")
- .IsUnique();
-
- b.ToTable("GroupMembers");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("text")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<DateTime?>("ClearedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ClientIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("ClientPublicKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedDecryptionKey")
- .HasColumnType("text");
-
- b.Property<DateTime?>("FulfilledAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("MobileIpAddress")
- .HasColumnType("text");
-
- b.Property<DateTime?>("RetrievedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");
-
- b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");
-
- b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");
-
- b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");
-
- b.HasIndex(new[] { "UserId" }, "IX_UserId");
-
- b.ToTable("MobileLoginRequests");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AppliesToAccountAgeMaxDays")
- .HasColumnType("integer");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("EffectiveFrom")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("EffectiveUntil")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("LimitType")
- .HasColumnType("integer");
-
- b.Property<int>("MaxCount")
- .HasColumnType("integer");
-
- b.Property<string>("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<int?>("Tier")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("WindowSeconds")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("Tier");
-
- b.HasIndex("LimitType", "Enabled");
-
- b.ToTable("RateLimits");
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("time without time zone");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("text");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("boolean");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("time without time zone");
-
- b.Property<int>("Status")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<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.VaultBlobObject", b =>
- {
- b.Property<string>("Hash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("OwnerUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Category")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("LastReferencedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("SizeBytes")
- .HasColumnType("integer");
-
- b.HasKey("Hash", "OwnerUserId");
-
- b.HasIndex("OwnerUserId", "Category");
-
- b.ToTable("VaultBlobObjects");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("BlobHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");
-
- b.ToTable("VaultBlobReferences");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category");
-
- b.ToTable("VaultDataBuckets");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category", "RevisionNumber");
-
- b.ToTable("VaultDataBucketsHistory");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.Property<Guid>("ManifestId")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("OwnerGroupId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId");
-
- b.HasIndex("OwnerGroupId");
-
- b.ToTable("VaultManifests");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedVek")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Metadata")
- .HasColumnType("jsonb");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("VaultManifestId")
- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");
-
- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");
-
- b.ToTable("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("boolean");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("VaultManifestId")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")
- .HasFilter("\"IsPrimary\"");
-
- b.HasIndex("VaultManifestId", "IsPrimary");
-
- b.ToTable("VaultManifestDeliveryKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId", "RevisionNumber");
-
- b.ToTable("VaultManifestsHistory", (string)null);
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("FriendlyName")
- .HasColumnType("text");
-
- b.Property<string>("Xml")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("ClaimType")
- .HasColumnType("text");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("text");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
-
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.HasOne("AliasServerDb.Group", "PersonalGroup")
- .WithOne()
- .HasForeignKey("AliasServerDb.AliasVaultUser", "PersonalGroupId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
-
- b.Navigation("PersonalGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.ClientAction", b =>
- {
- b.HasOne("AliasServerDb.Group", "TargetGroup")
- .WithMany()
- .HasForeignKey("TargetGroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "TargetUser")
- .WithMany()
- .HasForeignKey("TargetUserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("TargetGroup");
-
- b.Navigation("TargetUser");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")
- .WithMany("Links")
- .HasForeignKey("EmailClaimId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EmailClaim");
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("DecryptionKeys")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")
- .WithMany("DecryptionKeys")
- .HasForeignKey("VaultManifestDeliveryKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
- .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId");
-
- b.Navigation("Email");
-
- b.Navigation("VaultManifestDeliveryKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailPart", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Parts")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "Invitee")
- .WithMany()
- .HasForeignKey("InviteeUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "Inviter")
- .WithMany()
- .HasForeignKey("InviterUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("Group");
-
- b.Navigation("Invitee");
-
- b.Navigation("Inviter");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany("Members")
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Group");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("Group");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("OwnerUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")
- .WithMany()
- .HasForeignKey("ManifestId", "Category")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Bucket");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.HasOne("AliasServerDb.Group", "OwnerGroup")
- .WithMany()
- .HasForeignKey("OwnerGroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("OwnerGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("VaultManifestAccessKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
-
- b.Navigation("DecryptionKeys");
-
- b.Navigation("Parts");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Navigation("Links");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Navigation("Members");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Navigation("DecryptionKeys");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260822183612_AddGroupInvitationVaultKeyVersion.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs
similarity index 99%
rename from apps/server/Databases/AliasServerDb/Migrations/20260822183612_AddGroupInvitationVaultKeyVersion.Designer.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs
index 5b1677061..5b571466f 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260822183612_AddGroupInvitationVaultKeyVersion.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs
@@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace AliasServerDb.Migrations
{
[DbContext(typeof(AliasServerDbContext))]
- [Migration("20260822183612_AddGroupInvitationVaultKeyVersion")]
- partial class AddGroupInvitationVaultKeyVersion
+ [Migration("20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules")]
+ partial class AddGroupInvitationsClientActionsAndCapabilityRules
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsAndClientActions.cs b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.cs
similarity index 58%
rename from apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsAndClientActions.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.cs
index 58f8e7003..9f1b5e857 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsAndClientActions.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.cs
@@ -1,12 +1,15 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AliasServerDb.Migrations
{
- /// <inheritdoc />
- public partial class AddGroupInvitationsAndClientActions : Migration
+ /// <summary>
+ /// Adds the tables the server needs to drive a client: an invitation to a shared manifest, the actions a client
+ /// picks up on its next status call, and the rules that resolve which capabilities a caller is entitled to use.
+ /// </summary>
+ public partial class AddGroupInvitationsClientActionsAndCapabilityRules : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
@@ -51,7 +54,9 @@ namespace AliasServerDb.Migrations
InviteeUserId = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
Role = table.Column<int>(type: "integer", nullable: false),
VaultManifestId = table.Column<Guid>(type: "uuid", nullable: true),
+ EncryptedName = table.Column<string>(type: "text", 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),
Algorithm = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
State = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
@@ -88,6 +93,43 @@ namespace AliasServerDb.Migrations
onDelete: ReferentialAction.SetNull);
});
+ migrationBuilder.CreateTable(
+ name: "CapabilityRules",
+ columns: table => new
+ {
+ Id = table.Column<Guid>(type: "uuid", nullable: false),
+ CapabilityKey = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
+ Kind = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
+ UserId = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
+ GroupId = table.Column<Guid>(type: "uuid", nullable: true),
+ Tier = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: true),
+ Value = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
+ ClientName = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
+ Enabled = table.Column<bool>(type: "boolean", nullable: false),
+ EffectiveFrom = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
+ EffectiveUntil = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
+ Notes = table.Column<string>(type: "character varying(1000)", maxLength: 1000, nullable: true),
+ CreatedBy = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
+ 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_CapabilityRules", x => x.Id);
+ table.ForeignKey(
+ name: "FK_CapabilityRules_AliasVaultUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AliasVaultUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_CapabilityRules_Groups_GroupId",
+ column: x => x.GroupId,
+ principalTable: "Groups",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
migrationBuilder.CreateIndex(
name: "IX_ClientActions_TargetGroupId",
table: "ClientActions",
@@ -98,6 +140,11 @@ namespace AliasServerDb.Migrations
table: "ClientActions",
column: "TargetUserId");
+ migrationBuilder.CreateIndex(
+ name: "IX_GroupInvitations_GroupId",
+ table: "GroupInvitations",
+ column: "GroupId");
+
migrationBuilder.CreateIndex(
name: "IX_GroupInvitations_InviteeUserId_State",
table: "GroupInvitations",
@@ -113,17 +160,42 @@ namespace AliasServerDb.Migrations
table: "GroupInvitations",
column: "UserGrantKeyId");
+ // A user can hold at most one pending invitation per shared manifest, not per group: a group can own
+ // several manifests and each of them is invited to separately.
migrationBuilder.CreateIndex(
- name: "UX_GroupInvitations_Group_Invitee_Pending",
+ name: "UX_GroupInvitations_Manifest_Invitee_Pending",
table: "GroupInvitations",
- columns: new[] { "GroupId", "InviteeUserId" },
+ columns: new[] { "VaultManifestId", "InviteeUserId" },
unique: true,
filter: "\"State\" = 'Pending'");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CapabilityRules_CapabilityKey_Enabled",
+ table: "CapabilityRules",
+ columns: new[] { "CapabilityKey", "Enabled" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CapabilityRules_GroupId",
+ table: "CapabilityRules",
+ column: "GroupId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CapabilityRules_Tier",
+ table: "CapabilityRules",
+ column: "Tier");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CapabilityRules_UserId",
+ table: "CapabilityRules",
+ column: "UserId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
+ migrationBuilder.DropTable(
+ name: "CapabilityRules");
+
migrationBuilder.DropTable(
name: "ClientActions");
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260821145822_AddCapabilityRules.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260821145822_AddCapabilityRules.Designer.cs
deleted file mode 100644
index a7e76ac07..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260821145822_AddCapabilityRules.Designer.cs
+++ /dev/null
@@ -1,1926 +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("20260821145822_AddCapabilityRules")]
- partial class AddCapabilityRules
- {
- /// <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(100)
- .HasColumnType("character varying(100)");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.BlockedIpRange", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<bool>("BlockLogin")
- .HasColumnType("boolean");
-
- b.Property<bool>("BlockRegistration")
- .HasColumnType("boolean");
-
- b.Property<bool>("BlockShadow")
- .HasColumnType("boolean");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<string>("IpRange")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("Reason")
- .HasMaxLength(500)
- .HasColumnType("character varying(500)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "Enabled" }, "IX_BlockedIpRange_Enabled");
-
- b.HasIndex(new[] { "IpRange" }, "IX_BlockedIpRange_IpRange")
- .IsUnique();
-
- b.ToTable("BlockedIpRanges");
- });
-
- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("CapabilityKey")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientName")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("EffectiveFrom")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("EffectiveUntil")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("Kind")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<string>("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Tier")
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("Tier");
-
- b.HasIndex("UserId");
-
- b.HasIndex("CapabilityKey", "Enabled");
-
- b.ToTable("CapabilityRules");
- });
-
- modelBuilder.Entity("AliasServerDb.ClientAction", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Payload")
- .HasColumnType("jsonb");
-
- b.Property<Guid?>("TargetGroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("TargetUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("TargetGroupId");
-
- b.HasIndex("TargetUserId");
-
- b.ToTable("ClientActions");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<int>("AttachmentCount")
- .HasColumnType("integer");
-
- b.Property<DateTime>("Date")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("text");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("text");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("text");
-
- b.Property<string>("MessageSource")
- .HasColumnType("text");
-
- b.Property<byte[]>("MessageSourceBytes")
- .HasColumnType("bytea");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("boolean");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<bool>("Visible")
- .HasColumnType("boolean");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("Visible");
-
- b.HasIndex("To", "DateSystem");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<DateTime>("Date")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("Filesize")
- .HasColumnType("integer");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("AnonymizedSenderCounted")
- .HasColumnType("boolean");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.ToTable("EmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.Property<Guid>("EmailClaimId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.HasKey("EmailClaimId", "VaultManifestId");
-
- b.HasIndex("EmailClaimId")
- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")
- .HasFilter("\"State\" <> 'Removed'");
-
- b.HasIndex("VaultManifestId", "EmailClaimId");
-
- b.ToTable("EmailClaimLinks");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<Guid>("VaultManifestDeliveryKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("EmailId", "VaultManifestDeliveryKeyId");
-
- b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");
-
- b.ToTable("EmailDecryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailPart", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<int>("PartIndex")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId", "PartIndex")
- .IsUnique();
-
- b.ToTable("EmailParts");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.PrimitiveCollection<int[]>("AnonymizedEmailAliasSenderCounts")
- .IsRequired()
- .ValueGeneratedOnAdd()
- .HasColumnType("integer[]")
- .HasDefaultValueSql("array_fill(0, ARRAY[64])");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailsReceived")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmailAgeDays")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmails")
- .HasColumnType("integer");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("ShadowBlocked")
- .HasColumnType("boolean");
-
- b.Property<DateTime?>("ShadowBlockedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Type")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.ToTable("Groups");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedVek")
- .HasColumnType("text");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("InviteeUserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("InviterUserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("RespondedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<Guid?>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("InviterUserId");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("GroupId", "InviteeUserId")
- .IsUnique()
- .HasDatabaseName("UX_GroupInvitations_Group_Invitee_Pending")
- .HasFilter("\"State\" = 'Pending'");
-
- b.HasIndex("InviteeUserId", "State");
-
- b.ToTable("GroupInvitations");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.HasIndex("GroupId", "UserId")
- .IsUnique();
-
- b.ToTable("GroupMembers");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("text")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<DateTime?>("ClearedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ClientIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("ClientPublicKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedDecryptionKey")
- .HasColumnType("text");
-
- b.Property<DateTime?>("FulfilledAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("MobileIpAddress")
- .HasColumnType("text");
-
- b.Property<DateTime?>("RetrievedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");
-
- b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");
-
- b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");
-
- b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");
-
- b.HasIndex(new[] { "UserId" }, "IX_UserId");
-
- b.ToTable("MobileLoginRequests");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AppliesToAccountAgeMaxDays")
- .HasColumnType("integer");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("EffectiveFrom")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("EffectiveUntil")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("LimitType")
- .HasColumnType("integer");
-
- b.Property<int>("MaxCount")
- .HasColumnType("integer");
-
- b.Property<string>("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<int?>("Tier")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("WindowSeconds")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("Tier");
-
- b.HasIndex("LimitType", "Enabled");
-
- b.ToTable("RateLimits");
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("time without time zone");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("text");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("boolean");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("time without time zone");
-
- b.Property<int>("Status")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<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.VaultBlobObject", b =>
- {
- b.Property<string>("Hash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("OwnerUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Category")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("LastReferencedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("SizeBytes")
- .HasColumnType("integer");
-
- b.HasKey("Hash", "OwnerUserId");
-
- b.HasIndex("OwnerUserId", "Category");
-
- b.ToTable("VaultBlobObjects");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("BlobHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");
-
- b.ToTable("VaultBlobReferences");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category");
-
- b.ToTable("VaultDataBuckets");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category", "RevisionNumber");
-
- b.ToTable("VaultDataBucketsHistory");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.Property<Guid>("ManifestId")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("OwnerGroupId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId");
-
- b.HasIndex("OwnerGroupId");
-
- b.ToTable("VaultManifests");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedVek")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Metadata")
- .HasColumnType("jsonb");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("VaultManifestId")
- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");
-
- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");
-
- b.ToTable("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("boolean");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("VaultManifestId")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")
- .HasFilter("\"IsPrimary\"");
-
- b.HasIndex("VaultManifestId", "IsPrimary");
-
- b.ToTable("VaultManifestDeliveryKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId", "RevisionNumber");
-
- b.ToTable("VaultManifestsHistory", (string)null);
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("FriendlyName")
- .HasColumnType("text");
-
- b.Property<string>("Xml")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("ClaimType")
- .HasColumnType("text");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("text");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
-
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.HasOne("AliasServerDb.Group", "PersonalGroup")
- .WithOne()
- .HasForeignKey("AliasServerDb.AliasVaultUser", "PersonalGroupId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
-
- b.Navigation("PersonalGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("Group");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.ClientAction", b =>
- {
- b.HasOne("AliasServerDb.Group", "TargetGroup")
- .WithMany()
- .HasForeignKey("TargetGroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "TargetUser")
- .WithMany()
- .HasForeignKey("TargetUserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("TargetGroup");
-
- b.Navigation("TargetUser");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")
- .WithMany("Links")
- .HasForeignKey("EmailClaimId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EmailClaim");
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("DecryptionKeys")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")
- .WithMany("DecryptionKeys")
- .HasForeignKey("VaultManifestDeliveryKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
- .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId");
-
- b.Navigation("Email");
-
- b.Navigation("VaultManifestDeliveryKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailPart", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Parts")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "Invitee")
- .WithMany()
- .HasForeignKey("InviteeUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "Inviter")
- .WithMany()
- .HasForeignKey("InviterUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("Group");
-
- b.Navigation("Invitee");
-
- b.Navigation("Inviter");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany("Members")
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Group");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("Group");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("OwnerUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")
- .WithMany()
- .HasForeignKey("ManifestId", "Category")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Bucket");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.HasOne("AliasServerDb.Group", "OwnerGroup")
- .WithMany()
- .HasForeignKey("OwnerGroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("OwnerGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("VaultManifestAccessKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
-
- b.Navigation("DecryptionKeys");
-
- b.Navigation("Parts");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Navigation("Links");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Navigation("Members");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Navigation("DecryptionKeys");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260821145822_AddCapabilityRules.cs b/apps/server/Databases/AliasServerDb/Migrations/20260821145822_AddCapabilityRules.cs
deleted file mode 100644
index 85b5622f7..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260821145822_AddCapabilityRules.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations
-{
- /// <inheritdoc />
- public partial class AddCapabilityRules : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "CapabilityRules",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "uuid", nullable: false),
- CapabilityKey = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
- Kind = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
- UserId = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
- GroupId = table.Column<Guid>(type: "uuid", nullable: true),
- Tier = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: true),
- Value = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
- ClientName = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
- Enabled = table.Column<bool>(type: "boolean", nullable: false),
- EffectiveFrom = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
- EffectiveUntil = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
- Notes = table.Column<string>(type: "character varying(1000)", maxLength: 1000, nullable: true),
- CreatedBy = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
- 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_CapabilityRules", x => x.Id);
- table.ForeignKey(
- name: "FK_CapabilityRules_AliasVaultUsers_UserId",
- column: x => x.UserId,
- principalTable: "AliasVaultUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_CapabilityRules_Groups_GroupId",
- column: x => x.GroupId,
- principalTable: "Groups",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_CapabilityRules_CapabilityKey_Enabled",
- table: "CapabilityRules",
- columns: new[] { "CapabilityKey", "Enabled" });
-
- migrationBuilder.CreateIndex(
- name: "IX_CapabilityRules_GroupId",
- table: "CapabilityRules",
- column: "GroupId");
-
- migrationBuilder.CreateIndex(
- name: "IX_CapabilityRules_Tier",
- table: "CapabilityRules",
- column: "Tier");
-
- migrationBuilder.CreateIndex(
- name: "IX_CapabilityRules_UserId",
- table: "CapabilityRules",
- column: "UserId");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "CapabilityRules");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260821180325_DropVaultManifestName.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260821180325_DropVaultManifestName.Designer.cs
deleted file mode 100644
index bc1ccdf02..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260821180325_DropVaultManifestName.Designer.cs
+++ /dev/null
@@ -1,1922 +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("20260821180325_DropVaultManifestName")]
- partial class DropVaultManifestName
- {
- /// <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(100)
- .HasColumnType("character varying(100)");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.BlockedIpRange", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<bool>("BlockLogin")
- .HasColumnType("boolean");
-
- b.Property<bool>("BlockRegistration")
- .HasColumnType("boolean");
-
- b.Property<bool>("BlockShadow")
- .HasColumnType("boolean");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<string>("IpRange")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("Reason")
- .HasMaxLength(500)
- .HasColumnType("character varying(500)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "Enabled" }, "IX_BlockedIpRange_Enabled");
-
- b.HasIndex(new[] { "IpRange" }, "IX_BlockedIpRange_IpRange")
- .IsUnique();
-
- b.ToTable("BlockedIpRanges");
- });
-
- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("CapabilityKey")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientName")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("EffectiveFrom")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("EffectiveUntil")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("Kind")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<string>("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Tier")
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("Tier");
-
- b.HasIndex("UserId");
-
- b.HasIndex("CapabilityKey", "Enabled");
-
- b.ToTable("CapabilityRules");
- });
-
- modelBuilder.Entity("AliasServerDb.ClientAction", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Payload")
- .HasColumnType("jsonb");
-
- b.Property<Guid?>("TargetGroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("TargetUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("TargetGroupId");
-
- b.HasIndex("TargetUserId");
-
- b.ToTable("ClientActions");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<int>("AttachmentCount")
- .HasColumnType("integer");
-
- b.Property<DateTime>("Date")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("text");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("text");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("text");
-
- b.Property<string>("MessageSource")
- .HasColumnType("text");
-
- b.Property<byte[]>("MessageSourceBytes")
- .HasColumnType("bytea");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("boolean");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<bool>("Visible")
- .HasColumnType("boolean");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("Visible");
-
- b.HasIndex("To", "DateSystem");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<DateTime>("Date")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("Filesize")
- .HasColumnType("integer");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("AnonymizedSenderCounted")
- .HasColumnType("boolean");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.ToTable("EmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.Property<Guid>("EmailClaimId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.HasKey("EmailClaimId", "VaultManifestId");
-
- b.HasIndex("EmailClaimId")
- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")
- .HasFilter("\"State\" <> 'Removed'");
-
- b.HasIndex("VaultManifestId", "EmailClaimId");
-
- b.ToTable("EmailClaimLinks");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<Guid>("VaultManifestDeliveryKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("EmailId", "VaultManifestDeliveryKeyId");
-
- b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");
-
- b.ToTable("EmailDecryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailPart", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<int>("PartIndex")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId", "PartIndex")
- .IsUnique();
-
- b.ToTable("EmailParts");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.PrimitiveCollection<int[]>("AnonymizedEmailAliasSenderCounts")
- .IsRequired()
- .ValueGeneratedOnAdd()
- .HasColumnType("integer[]")
- .HasDefaultValueSql("array_fill(0, ARRAY[64])");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailsReceived")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmailAgeDays")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmails")
- .HasColumnType("integer");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("ShadowBlocked")
- .HasColumnType("boolean");
-
- b.Property<DateTime?>("ShadowBlockedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Type")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.ToTable("Groups");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedVek")
- .HasColumnType("text");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("InviteeUserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("InviterUserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("RespondedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<Guid?>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("InviterUserId");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("GroupId", "InviteeUserId")
- .IsUnique()
- .HasDatabaseName("UX_GroupInvitations_Group_Invitee_Pending")
- .HasFilter("\"State\" = 'Pending'");
-
- b.HasIndex("InviteeUserId", "State");
-
- b.ToTable("GroupInvitations");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.HasIndex("GroupId", "UserId")
- .IsUnique();
-
- b.ToTable("GroupMembers");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("text")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<DateTime?>("ClearedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ClientIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("ClientPublicKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedDecryptionKey")
- .HasColumnType("text");
-
- b.Property<DateTime?>("FulfilledAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("MobileIpAddress")
- .HasColumnType("text");
-
- b.Property<DateTime?>("RetrievedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");
-
- b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");
-
- b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");
-
- b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");
-
- b.HasIndex(new[] { "UserId" }, "IX_UserId");
-
- b.ToTable("MobileLoginRequests");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AppliesToAccountAgeMaxDays")
- .HasColumnType("integer");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("EffectiveFrom")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("EffectiveUntil")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("LimitType")
- .HasColumnType("integer");
-
- b.Property<int>("MaxCount")
- .HasColumnType("integer");
-
- b.Property<string>("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<int?>("Tier")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("WindowSeconds")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("Tier");
-
- b.HasIndex("LimitType", "Enabled");
-
- b.ToTable("RateLimits");
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("time without time zone");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("text");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("boolean");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("time without time zone");
-
- b.Property<int>("Status")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<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.VaultBlobObject", b =>
- {
- b.Property<string>("Hash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("OwnerUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Category")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("LastReferencedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("SizeBytes")
- .HasColumnType("integer");
-
- b.HasKey("Hash", "OwnerUserId");
-
- b.HasIndex("OwnerUserId", "Category");
-
- b.ToTable("VaultBlobObjects");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("BlobHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");
-
- b.ToTable("VaultBlobReferences");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category");
-
- b.ToTable("VaultDataBuckets");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category", "RevisionNumber");
-
- b.ToTable("VaultDataBucketsHistory");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.Property<Guid>("ManifestId")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<Guid>("OwnerGroupId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId");
-
- b.HasIndex("OwnerGroupId");
-
- b.ToTable("VaultManifests");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedVek")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Metadata")
- .HasColumnType("jsonb");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("VaultManifestId")
- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");
-
- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");
-
- b.ToTable("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("boolean");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("VaultManifestId")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")
- .HasFilter("\"IsPrimary\"");
-
- b.HasIndex("VaultManifestId", "IsPrimary");
-
- b.ToTable("VaultManifestDeliveryKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId", "RevisionNumber");
-
- b.ToTable("VaultManifestsHistory", (string)null);
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("FriendlyName")
- .HasColumnType("text");
-
- b.Property<string>("Xml")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("ClaimType")
- .HasColumnType("text");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("text");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
-
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.HasOne("AliasServerDb.Group", "PersonalGroup")
- .WithOne()
- .HasForeignKey("AliasServerDb.AliasVaultUser", "PersonalGroupId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
-
- b.Navigation("PersonalGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("Group");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.ClientAction", b =>
- {
- b.HasOne("AliasServerDb.Group", "TargetGroup")
- .WithMany()
- .HasForeignKey("TargetGroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "TargetUser")
- .WithMany()
- .HasForeignKey("TargetUserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("TargetGroup");
-
- b.Navigation("TargetUser");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")
- .WithMany("Links")
- .HasForeignKey("EmailClaimId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EmailClaim");
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("DecryptionKeys")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")
- .WithMany("DecryptionKeys")
- .HasForeignKey("VaultManifestDeliveryKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
- .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId");
-
- b.Navigation("Email");
-
- b.Navigation("VaultManifestDeliveryKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailPart", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Parts")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "Invitee")
- .WithMany()
- .HasForeignKey("InviteeUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "Inviter")
- .WithMany()
- .HasForeignKey("InviterUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("Group");
-
- b.Navigation("Invitee");
-
- b.Navigation("Inviter");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany("Members")
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Group");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("Group");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("OwnerUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")
- .WithMany()
- .HasForeignKey("ManifestId", "Category")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Bucket");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.HasOne("AliasServerDb.Group", "OwnerGroup")
- .WithMany()
- .HasForeignKey("OwnerGroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("OwnerGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("VaultManifestAccessKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
-
- b.Navigation("DecryptionKeys");
-
- b.Navigation("Parts");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Navigation("Links");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Navigation("Members");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Navigation("DecryptionKeys");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260821180325_DropVaultManifestName.cs b/apps/server/Databases/AliasServerDb/Migrations/20260821180325_DropVaultManifestName.cs
deleted file mode 100644
index e863d5422..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260821180325_DropVaultManifestName.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations
-{
- /// <inheritdoc />
- public partial class DropVaultManifestName : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "Name",
- table: "VaultManifests");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<string>(
- name: "Name",
- table: "VaultManifests",
- type: "character varying(255)",
- maxLength: 255,
- nullable: true);
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260821185744_ScopeGroupInvitationUniquenessToManifest.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260821185744_ScopeGroupInvitationUniquenessToManifest.Designer.cs
deleted file mode 100644
index f24803f52..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260821185744_ScopeGroupInvitationUniquenessToManifest.Designer.cs
+++ /dev/null
@@ -1,1924 +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("20260821185744_ScopeGroupInvitationUniquenessToManifest")]
- partial class ScopeGroupInvitationUniquenessToManifest
- {
- /// <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(100)
- .HasColumnType("character varying(100)");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.BlockedIpRange", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<bool>("BlockLogin")
- .HasColumnType("boolean");
-
- b.Property<bool>("BlockRegistration")
- .HasColumnType("boolean");
-
- b.Property<bool>("BlockShadow")
- .HasColumnType("boolean");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<string>("IpRange")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("Reason")
- .HasMaxLength(500)
- .HasColumnType("character varying(500)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "Enabled" }, "IX_BlockedIpRange_Enabled");
-
- b.HasIndex(new[] { "IpRange" }, "IX_BlockedIpRange_IpRange")
- .IsUnique();
-
- b.ToTable("BlockedIpRanges");
- });
-
- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("CapabilityKey")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientName")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("EffectiveFrom")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("EffectiveUntil")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("Kind")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<string>("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Tier")
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("Tier");
-
- b.HasIndex("UserId");
-
- b.HasIndex("CapabilityKey", "Enabled");
-
- b.ToTable("CapabilityRules");
- });
-
- modelBuilder.Entity("AliasServerDb.ClientAction", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Payload")
- .HasColumnType("jsonb");
-
- b.Property<Guid?>("TargetGroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("TargetUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("TargetGroupId");
-
- b.HasIndex("TargetUserId");
-
- b.ToTable("ClientActions");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<int>("AttachmentCount")
- .HasColumnType("integer");
-
- b.Property<DateTime>("Date")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("text");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("text");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("text");
-
- b.Property<string>("MessageSource")
- .HasColumnType("text");
-
- b.Property<byte[]>("MessageSourceBytes")
- .HasColumnType("bytea");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("boolean");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<bool>("Visible")
- .HasColumnType("boolean");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("Visible");
-
- b.HasIndex("To", "DateSystem");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<DateTime>("Date")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("Filesize")
- .HasColumnType("integer");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("AnonymizedSenderCounted")
- .HasColumnType("boolean");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.ToTable("EmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.Property<Guid>("EmailClaimId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.HasKey("EmailClaimId", "VaultManifestId");
-
- b.HasIndex("EmailClaimId")
- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")
- .HasFilter("\"State\" <> 'Removed'");
-
- b.HasIndex("VaultManifestId", "EmailClaimId");
-
- b.ToTable("EmailClaimLinks");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<Guid>("VaultManifestDeliveryKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("EmailId", "VaultManifestDeliveryKeyId");
-
- b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");
-
- b.ToTable("EmailDecryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailPart", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<int>("PartIndex")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId", "PartIndex")
- .IsUnique();
-
- b.ToTable("EmailParts");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.PrimitiveCollection<int[]>("AnonymizedEmailAliasSenderCounts")
- .IsRequired()
- .ValueGeneratedOnAdd()
- .HasColumnType("integer[]")
- .HasDefaultValueSql("array_fill(0, ARRAY[64])");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailsReceived")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmailAgeDays")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmails")
- .HasColumnType("integer");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("ShadowBlocked")
- .HasColumnType("boolean");
-
- b.Property<DateTime?>("ShadowBlockedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Type")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.ToTable("Groups");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedVek")
- .HasColumnType("text");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("InviteeUserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("InviterUserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("RespondedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<Guid?>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("InviterUserId");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("InviteeUserId", "State");
-
- b.HasIndex("VaultManifestId", "InviteeUserId")
- .IsUnique()
- .HasDatabaseName("UX_GroupInvitations_Manifest_Invitee_Pending")
- .HasFilter("\"State\" = 'Pending'");
-
- b.ToTable("GroupInvitations");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.HasIndex("GroupId", "UserId")
- .IsUnique();
-
- b.ToTable("GroupMembers");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("text")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<DateTime?>("ClearedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ClientIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("ClientPublicKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedDecryptionKey")
- .HasColumnType("text");
-
- b.Property<DateTime?>("FulfilledAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("MobileIpAddress")
- .HasColumnType("text");
-
- b.Property<DateTime?>("RetrievedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");
-
- b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");
-
- b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");
-
- b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");
-
- b.HasIndex(new[] { "UserId" }, "IX_UserId");
-
- b.ToTable("MobileLoginRequests");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AppliesToAccountAgeMaxDays")
- .HasColumnType("integer");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("EffectiveFrom")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("EffectiveUntil")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("LimitType")
- .HasColumnType("integer");
-
- b.Property<int>("MaxCount")
- .HasColumnType("integer");
-
- b.Property<string>("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<int?>("Tier")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("WindowSeconds")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("Tier");
-
- b.HasIndex("LimitType", "Enabled");
-
- b.ToTable("RateLimits");
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("time without time zone");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("text");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("boolean");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("time without time zone");
-
- b.Property<int>("Status")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<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.VaultBlobObject", b =>
- {
- b.Property<string>("Hash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("OwnerUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Category")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("LastReferencedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("SizeBytes")
- .HasColumnType("integer");
-
- b.HasKey("Hash", "OwnerUserId");
-
- b.HasIndex("OwnerUserId", "Category");
-
- b.ToTable("VaultBlobObjects");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("BlobHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");
-
- b.ToTable("VaultBlobReferences");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category");
-
- b.ToTable("VaultDataBuckets");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category", "RevisionNumber");
-
- b.ToTable("VaultDataBucketsHistory");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.Property<Guid>("ManifestId")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<Guid>("OwnerGroupId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId");
-
- b.HasIndex("OwnerGroupId");
-
- b.ToTable("VaultManifests");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedVek")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Metadata")
- .HasColumnType("jsonb");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("VaultManifestId")
- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");
-
- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");
-
- b.ToTable("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("boolean");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("VaultManifestId")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")
- .HasFilter("\"IsPrimary\"");
-
- b.HasIndex("VaultManifestId", "IsPrimary");
-
- b.ToTable("VaultManifestDeliveryKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId", "RevisionNumber");
-
- b.ToTable("VaultManifestsHistory", (string)null);
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("FriendlyName")
- .HasColumnType("text");
-
- b.Property<string>("Xml")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("ClaimType")
- .HasColumnType("text");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("text");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
-
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.HasOne("AliasServerDb.Group", "PersonalGroup")
- .WithOne()
- .HasForeignKey("AliasServerDb.AliasVaultUser", "PersonalGroupId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
-
- b.Navigation("PersonalGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("Group");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.ClientAction", b =>
- {
- b.HasOne("AliasServerDb.Group", "TargetGroup")
- .WithMany()
- .HasForeignKey("TargetGroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "TargetUser")
- .WithMany()
- .HasForeignKey("TargetUserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("TargetGroup");
-
- b.Navigation("TargetUser");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")
- .WithMany("Links")
- .HasForeignKey("EmailClaimId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EmailClaim");
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("DecryptionKeys")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")
- .WithMany("DecryptionKeys")
- .HasForeignKey("VaultManifestDeliveryKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
- .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId");
-
- b.Navigation("Email");
-
- b.Navigation("VaultManifestDeliveryKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailPart", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Parts")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "Invitee")
- .WithMany()
- .HasForeignKey("InviteeUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "Inviter")
- .WithMany()
- .HasForeignKey("InviterUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("Group");
-
- b.Navigation("Invitee");
-
- b.Navigation("Inviter");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany("Members")
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Group");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("Group");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("OwnerUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")
- .WithMany()
- .HasForeignKey("ManifestId", "Category")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Bucket");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.HasOne("AliasServerDb.Group", "OwnerGroup")
- .WithMany()
- .HasForeignKey("OwnerGroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("OwnerGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("VaultManifestAccessKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
-
- b.Navigation("DecryptionKeys");
-
- b.Navigation("Parts");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Navigation("Links");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Navigation("Members");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Navigation("DecryptionKeys");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260821185744_ScopeGroupInvitationUniquenessToManifest.cs b/apps/server/Databases/AliasServerDb/Migrations/20260821185744_ScopeGroupInvitationUniquenessToManifest.cs
deleted file mode 100644
index b4961279a..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260821185744_ScopeGroupInvitationUniquenessToManifest.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations
-{
- /// <inheritdoc />
- public partial class ScopeGroupInvitationUniquenessToManifest : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropIndex(
- name: "UX_GroupInvitations_Group_Invitee_Pending",
- table: "GroupInvitations");
-
- migrationBuilder.CreateIndex(
- name: "IX_GroupInvitations_GroupId",
- table: "GroupInvitations",
- column: "GroupId");
-
- migrationBuilder.CreateIndex(
- name: "UX_GroupInvitations_Manifest_Invitee_Pending",
- table: "GroupInvitations",
- columns: new[] { "VaultManifestId", "InviteeUserId" },
- unique: true,
- filter: "\"State\" = 'Pending'");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropIndex(
- name: "IX_GroupInvitations_GroupId",
- table: "GroupInvitations");
-
- migrationBuilder.DropIndex(
- name: "UX_GroupInvitations_Manifest_Invitee_Pending",
- table: "GroupInvitations");
-
- migrationBuilder.CreateIndex(
- name: "UX_GroupInvitations_Group_Invitee_Pending",
- table: "GroupInvitations",
- columns: new[] { "GroupId", "InviteeUserId" },
- unique: true,
- filter: "\"State\" = 'Pending'");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260821193638_AddGroupInvitationEncryptedName.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260821193638_AddGroupInvitationEncryptedName.Designer.cs
deleted file mode 100644
index 3d896932c..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260821193638_AddGroupInvitationEncryptedName.Designer.cs
+++ /dev/null
@@ -1,1927 +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("20260821193638_AddGroupInvitationEncryptedName")]
- partial class AddGroupInvitationEncryptedName
- {
- /// <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(100)
- .HasColumnType("character varying(100)");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.BlockedIpRange", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<bool>("BlockLogin")
- .HasColumnType("boolean");
-
- b.Property<bool>("BlockRegistration")
- .HasColumnType("boolean");
-
- b.Property<bool>("BlockShadow")
- .HasColumnType("boolean");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<string>("IpRange")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("Reason")
- .HasMaxLength(500)
- .HasColumnType("character varying(500)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "Enabled" }, "IX_BlockedIpRange_Enabled");
-
- b.HasIndex(new[] { "IpRange" }, "IX_BlockedIpRange_IpRange")
- .IsUnique();
-
- b.ToTable("BlockedIpRanges");
- });
-
- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("CapabilityKey")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientName")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("EffectiveFrom")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("EffectiveUntil")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("Kind")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<string>("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Tier")
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("Tier");
-
- b.HasIndex("UserId");
-
- b.HasIndex("CapabilityKey", "Enabled");
-
- b.ToTable("CapabilityRules");
- });
-
- modelBuilder.Entity("AliasServerDb.ClientAction", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Payload")
- .HasColumnType("jsonb");
-
- b.Property<Guid?>("TargetGroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("TargetUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("TargetGroupId");
-
- b.HasIndex("TargetUserId");
-
- b.ToTable("ClientActions");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<int>("AttachmentCount")
- .HasColumnType("integer");
-
- b.Property<DateTime>("Date")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("text");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("text");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("text");
-
- b.Property<string>("MessageSource")
- .HasColumnType("text");
-
- b.Property<byte[]>("MessageSourceBytes")
- .HasColumnType("bytea");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("boolean");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<bool>("Visible")
- .HasColumnType("boolean");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("Visible");
-
- b.HasIndex("To", "DateSystem");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<DateTime>("Date")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("Filesize")
- .HasColumnType("integer");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("AnonymizedSenderCounted")
- .HasColumnType("boolean");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.ToTable("EmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.Property<Guid>("EmailClaimId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.HasKey("EmailClaimId", "VaultManifestId");
-
- b.HasIndex("EmailClaimId")
- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")
- .HasFilter("\"State\" <> 'Removed'");
-
- b.HasIndex("VaultManifestId", "EmailClaimId");
-
- b.ToTable("EmailClaimLinks");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<Guid>("VaultManifestDeliveryKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("EmailId", "VaultManifestDeliveryKeyId");
-
- b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");
-
- b.ToTable("EmailDecryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailPart", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<int>("PartIndex")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId", "PartIndex")
- .IsUnique();
-
- b.ToTable("EmailParts");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.PrimitiveCollection<int[]>("AnonymizedEmailAliasSenderCounts")
- .IsRequired()
- .ValueGeneratedOnAdd()
- .HasColumnType("integer[]")
- .HasDefaultValueSql("array_fill(0, ARRAY[64])");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailsReceived")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmailAgeDays")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmails")
- .HasColumnType("integer");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("ShadowBlocked")
- .HasColumnType("boolean");
-
- b.Property<DateTime?>("ShadowBlockedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Type")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.ToTable("Groups");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedName")
- .HasColumnType("text");
-
- b.Property<string>("EncryptedVek")
- .HasColumnType("text");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("InviteeUserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("InviterUserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("RespondedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<Guid?>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("InviterUserId");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("InviteeUserId", "State");
-
- b.HasIndex("VaultManifestId", "InviteeUserId")
- .IsUnique()
- .HasDatabaseName("UX_GroupInvitations_Manifest_Invitee_Pending")
- .HasFilter("\"State\" = 'Pending'");
-
- b.ToTable("GroupInvitations");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.HasIndex("GroupId", "UserId")
- .IsUnique();
-
- b.ToTable("GroupMembers");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("text")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<DateTime?>("ClearedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ClientIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("ClientPublicKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedDecryptionKey")
- .HasColumnType("text");
-
- b.Property<DateTime?>("FulfilledAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("MobileIpAddress")
- .HasColumnType("text");
-
- b.Property<DateTime?>("RetrievedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");
-
- b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");
-
- b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");
-
- b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");
-
- b.HasIndex(new[] { "UserId" }, "IX_UserId");
-
- b.ToTable("MobileLoginRequests");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AppliesToAccountAgeMaxDays")
- .HasColumnType("integer");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("EffectiveFrom")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("EffectiveUntil")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("LimitType")
- .HasColumnType("integer");
-
- b.Property<int>("MaxCount")
- .HasColumnType("integer");
-
- b.Property<string>("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<int?>("Tier")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("WindowSeconds")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("Tier");
-
- b.HasIndex("LimitType", "Enabled");
-
- b.ToTable("RateLimits");
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("time without time zone");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("text");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("boolean");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("time without time zone");
-
- b.Property<int>("Status")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<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.VaultBlobObject", b =>
- {
- b.Property<string>("Hash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("OwnerUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Category")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("LastReferencedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("SizeBytes")
- .HasColumnType("integer");
-
- b.HasKey("Hash", "OwnerUserId");
-
- b.HasIndex("OwnerUserId", "Category");
-
- b.ToTable("VaultBlobObjects");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("BlobHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");
-
- b.ToTable("VaultBlobReferences");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category");
-
- b.ToTable("VaultDataBuckets");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category", "RevisionNumber");
-
- b.ToTable("VaultDataBucketsHistory");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.Property<Guid>("ManifestId")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<Guid>("OwnerGroupId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId");
-
- b.HasIndex("OwnerGroupId");
-
- b.ToTable("VaultManifests");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedVek")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Metadata")
- .HasColumnType("jsonb");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("VaultManifestId")
- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");
-
- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");
-
- b.ToTable("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("boolean");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("VaultManifestId")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")
- .HasFilter("\"IsPrimary\"");
-
- b.HasIndex("VaultManifestId", "IsPrimary");
-
- b.ToTable("VaultManifestDeliveryKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId", "RevisionNumber");
-
- b.ToTable("VaultManifestsHistory", (string)null);
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("FriendlyName")
- .HasColumnType("text");
-
- b.Property<string>("Xml")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("ClaimType")
- .HasColumnType("text");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("text");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
-
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.HasOne("AliasServerDb.Group", "PersonalGroup")
- .WithOne()
- .HasForeignKey("AliasServerDb.AliasVaultUser", "PersonalGroupId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
-
- b.Navigation("PersonalGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("Group");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.ClientAction", b =>
- {
- b.HasOne("AliasServerDb.Group", "TargetGroup")
- .WithMany()
- .HasForeignKey("TargetGroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "TargetUser")
- .WithMany()
- .HasForeignKey("TargetUserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("TargetGroup");
-
- b.Navigation("TargetUser");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")
- .WithMany("Links")
- .HasForeignKey("EmailClaimId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EmailClaim");
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("DecryptionKeys")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")
- .WithMany("DecryptionKeys")
- .HasForeignKey("VaultManifestDeliveryKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
- .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId");
-
- b.Navigation("Email");
-
- b.Navigation("VaultManifestDeliveryKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailPart", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Parts")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "Invitee")
- .WithMany()
- .HasForeignKey("InviteeUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "Inviter")
- .WithMany()
- .HasForeignKey("InviterUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("Group");
-
- b.Navigation("Invitee");
-
- b.Navigation("Inviter");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany("Members")
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Group");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("Group");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("OwnerUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")
- .WithMany()
- .HasForeignKey("ManifestId", "Category")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Bucket");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.HasOne("AliasServerDb.Group", "OwnerGroup")
- .WithMany()
- .HasForeignKey("OwnerGroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("OwnerGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("VaultManifestAccessKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
-
- b.Navigation("DecryptionKeys");
-
- b.Navigation("Parts");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Navigation("Links");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Navigation("Members");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Navigation("DecryptionKeys");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260821193638_AddGroupInvitationEncryptedName.cs b/apps/server/Databases/AliasServerDb/Migrations/20260821193638_AddGroupInvitationEncryptedName.cs
deleted file mode 100644
index f8aa28e5d..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260821193638_AddGroupInvitationEncryptedName.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations
-{
- /// <inheritdoc />
- public partial class AddGroupInvitationEncryptedName : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<string>(
- name: "EncryptedName",
- table: "GroupInvitations",
- type: "text",
- nullable: true);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "EncryptedName",
- table: "GroupInvitations");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260822141154_WidenAuthLogRequestPath.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260822141154_WidenAuthLogRequestPath.Designer.cs
deleted file mode 100644
index a48f783e8..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260822141154_WidenAuthLogRequestPath.Designer.cs
+++ /dev/null
@@ -1,1927 +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("20260822141154_WidenAuthLogRequestPath")]
- partial class WidenAuthLogRequestPath
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "10.0.10")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true)
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("integer");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("text");
-
- b.Property<string>("Email")
- .HasColumnType("text");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("boolean");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("boolean");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("text");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("text");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("text");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("text");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("boolean");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("text");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("boolean");
-
- b.Property<string>("UserName")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("integer");
-
- b.Property<bool>("Blocked")
- .HasColumnType("boolean");
-
- b.Property<DateTime?>("BlockedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Email")
- .HasColumnType("text");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("boolean");
-
- b.Property<DateTime?>("LastActivityDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("boolean");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("text");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("text");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("text");
-
- b.Property<Guid>("PersonalGroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("text");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("boolean");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("text");
-
- b.Property<string>("SrpIdentity")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("boolean");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserName")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex("PersonalGroupId")
- .IsUnique()
- .HasDatabaseName("UX_AliasVaultUsers_PersonalGroupId");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(45)
- .HasColumnType("character varying(45)");
-
- b.Property<string>("PreviousTokenValue")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("Client")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<int>("EventType")
- .HasColumnType("integer");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("integer");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("boolean");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("boolean");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.BlockedIpRange", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<bool>("BlockLogin")
- .HasColumnType("boolean");
-
- b.Property<bool>("BlockRegistration")
- .HasColumnType("boolean");
-
- b.Property<bool>("BlockShadow")
- .HasColumnType("boolean");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<string>("IpRange")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("Reason")
- .HasMaxLength(500)
- .HasColumnType("character varying(500)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "Enabled" }, "IX_BlockedIpRange_Enabled");
-
- b.HasIndex(new[] { "IpRange" }, "IX_BlockedIpRange_IpRange")
- .IsUnique();
-
- b.ToTable("BlockedIpRanges");
- });
-
- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("CapabilityKey")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("ClientName")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("EffectiveFrom")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("EffectiveUntil")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("Kind")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<string>("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Tier")
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("Tier");
-
- b.HasIndex("UserId");
-
- b.HasIndex("CapabilityKey", "Enabled");
-
- b.ToTable("CapabilityRules");
- });
-
- modelBuilder.Entity("AliasServerDb.ClientAction", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Payload")
- .HasColumnType("jsonb");
-
- b.Property<Guid?>("TargetGroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("TargetUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("TargetGroupId");
-
- b.HasIndex("TargetUserId");
-
- b.ToTable("ClientActions");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<int>("AttachmentCount")
- .HasColumnType("integer");
-
- b.Property<DateTime>("Date")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("text");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("text");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("text");
-
- b.Property<string>("MessageSource")
- .HasColumnType("text");
-
- b.Property<byte[]>("MessageSourceBytes")
- .HasColumnType("bytea");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("boolean");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<bool>("Visible")
- .HasColumnType("boolean");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("Visible");
-
- b.HasIndex("To", "DateSystem");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<DateTime>("Date")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("Filesize")
- .HasColumnType("integer");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("AnonymizedSenderCounted")
- .HasColumnType("boolean");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.ToTable("EmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.Property<Guid>("EmailClaimId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.HasKey("EmailClaimId", "VaultManifestId");
-
- b.HasIndex("EmailClaimId")
- .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")
- .HasFilter("\"State\" <> 'Removed'");
-
- b.HasIndex("VaultManifestId", "EmailClaimId");
-
- b.ToTable("EmailClaimLinks");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<Guid>("VaultManifestDeliveryKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("EmailId", "VaultManifestDeliveryKeyId");
-
- b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");
-
- b.ToTable("EmailDecryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailPart", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("EmailId")
- .HasColumnType("integer");
-
- b.Property<int>("PartIndex")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId", "PartIndex")
- .IsUnique();
-
- b.ToTable("EmailParts");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.PrimitiveCollection<int[]>("AnonymizedEmailAliasSenderCounts")
- .IsRequired()
- .ValueGeneratedOnAdd()
- .HasColumnType("integer[]")
- .HasDefaultValueSql("array_fill(0, ARRAY[64])");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("EmailsReceived")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmailAgeDays")
- .HasColumnType("integer");
-
- b.Property<int>("MaxEmails")
- .HasColumnType("integer");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<bool>("ShadowBlocked")
- .HasColumnType("boolean");
-
- b.Property<DateTime?>("ShadowBlockedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Type")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.ToTable("Groups");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedName")
- .HasColumnType("text");
-
- b.Property<string>("EncryptedVek")
- .HasColumnType("text");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<string>("InviteeUserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("InviterUserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("RespondedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<string>("State")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<Guid?>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("InviterUserId");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("InviteeUserId", "State");
-
- b.HasIndex("VaultManifestId", "InviteeUserId")
- .IsUnique()
- .HasDatabaseName("UX_GroupInvitations_Manifest_Invitee_Pending")
- .HasFilter("\"State\" = 'Pending'");
-
- b.ToTable("GroupInvitations");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("Role")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.HasIndex("GroupId", "UserId")
- .IsUnique();
-
- b.ToTable("GroupMembers");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("text")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("text");
-
- b.Property<DateTime?>("ClearedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ClientIpAddress")
- .HasColumnType("text");
-
- b.Property<string>("ClientPublicKey")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedDecryptionKey")
- .HasColumnType("text");
-
- b.Property<DateTime?>("FulfilledAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("MobileIpAddress")
- .HasColumnType("text");
-
- b.Property<DateTime?>("RetrievedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");
-
- b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");
-
- b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");
-
- b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");
-
- b.HasIndex(new[] { "UserId" }, "IX_UserId");
-
- b.ToTable("MobileLoginRequests");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AppliesToAccountAgeMaxDays")
- .HasColumnType("integer");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("CreatedBy")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime?>("EffectiveFrom")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime?>("EffectiveUntil")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("Enabled")
- .HasColumnType("boolean");
-
- b.Property<Guid?>("GroupId")
- .HasColumnType("uuid");
-
- b.Property<int>("LimitType")
- .HasColumnType("integer");
-
- b.Property<int>("MaxCount")
- .HasColumnType("integer");
-
- b.Property<string>("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<int?>("Tier")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("WindowSeconds")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupId");
-
- b.HasIndex("Tier");
-
- b.HasIndex("LimitType", "Enabled");
-
- b.ToTable("RateLimits");
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("time without time zone");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("text");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("boolean");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("time without time zone");
-
- b.Property<int>("Status")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<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.VaultBlobObject", b =>
- {
- b.Property<string>("Hash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("OwnerUserId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<string>("Category")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("LastReferencedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("SizeBytes")
- .HasColumnType("integer");
-
- b.HasKey("Hash", "OwnerUserId");
-
- b.HasIndex("OwnerUserId", "Category");
-
- b.ToTable("VaultBlobObjects");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("BlobHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.HasKey("ManifestId", "RevisionNumber", "BlobHash");
-
- b.ToTable("VaultBlobReferences");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category");
-
- b.ToTable("VaultDataBuckets");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<string>("Category")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("CiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<byte[]>("EncryptedData")
- .IsRequired()
- .HasColumnType("bytea");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ManifestId", "Category", "RevisionNumber");
-
- b.ToTable("VaultDataBucketsHistory");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.Property<Guid>("ManifestId")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<Guid>("OwnerGroupId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId");
-
- b.HasIndex("OwnerGroupId");
-
- b.ToTable("VaultManifests");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<int?>("AccountKeyVersion")
- .HasColumnType("integer");
-
- b.Property<string>("Algorithm")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("EncryptedVek")
- .IsRequired()
- .HasColumnType("text");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<DateTime?>("LastUsedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("Metadata")
- .HasColumnType("jsonb");
-
- b.Property<string>("Type")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid?>("UserGrantKeyId")
- .HasColumnType("uuid");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("UserGrantKeyId");
-
- b.HasIndex("VaultManifestId")
- .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");
-
- b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");
-
- b.ToTable("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("boolean");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<Guid>("VaultManifestId")
- .HasColumnType("uuid");
-
- b.HasKey("Id");
-
- b.HasIndex("VaultManifestId")
- .IsUnique()
- .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")
- .HasFilter("\"IsPrimary\"");
-
- b.HasIndex("VaultManifestId", "IsPrimary");
-
- b.ToTable("VaultManifestDeliveryKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.Property<Guid>("ManifestId")
- .HasColumnType("uuid");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("bigint");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("integer");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("integer");
-
- b.Property<string>("EncryptionSettings")
- .HasColumnType("text");
-
- b.Property<string>("EncryptionType")
- .HasColumnType("text");
-
- b.Property<int>("FileSize")
- .HasColumnType("integer");
-
- b.Property<int>("KeyVersion")
- .HasColumnType("integer");
-
- b.Property<byte[]>("ManifestBlob")
- .HasColumnType("bytea");
-
- b.Property<string>("ManifestCiphertextHash")
- .HasMaxLength(64)
- .HasColumnType("character varying(64)");
-
- b.Property<string>("Salt")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property<string>("StorageFormat")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("VaultBlob")
- .HasColumnType("text");
-
- b.Property<string>("Verifier")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property<string>("Version")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("ManifestId", "RevisionNumber");
-
- b.ToTable("VaultManifestsHistory", (string)null);
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("timestamp with time zone");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("FriendlyName")
- .HasColumnType("text");
-
- b.Property<string>("Xml")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
-
- b.Property<string>("ClaimType")
- .HasColumnType("text");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("text");
-
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("text");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
-
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.HasOne("AliasServerDb.Group", "PersonalGroup")
- .WithOne()
- .HasForeignKey("AliasServerDb.AliasVaultUser", "PersonalGroupId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
-
- b.Navigation("PersonalGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("Group");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.ClientAction", b =>
- {
- b.HasOne("AliasServerDb.Group", "TargetGroup")
- .WithMany()
- .HasForeignKey("TargetGroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "TargetUser")
- .WithMany()
- .HasForeignKey("TargetUserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("TargetGroup");
-
- b.Navigation("TargetUser");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>
- {
- b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")
- .WithMany("Links")
- .HasForeignKey("EmailClaimId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EmailClaim");
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("DecryptionKeys")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")
- .WithMany("DecryptionKeys")
- .HasForeignKey("VaultManifestDeliveryKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
- .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId");
-
- b.Navigation("Email");
-
- b.Navigation("VaultManifestDeliveryKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailPart", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Parts")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "Invitee")
- .WithMany()
- .HasForeignKey("InviteeUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "Inviter")
- .WithMany()
- .HasForeignKey("InviterUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("Group");
-
- b.Navigation("Invitee");
-
- b.Navigation("Inviter");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.GroupMember", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany("Members")
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Group");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.RateLimit", b =>
- {
- b.HasOne("AliasServerDb.Group", "Group")
- .WithMany()
- .HasForeignKey("GroupId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.Navigation("Group");
- });
-
- modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("OwnerUserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")
- .WithMany()
- .HasForeignKey("ManifestId", "Category")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Bucket");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifest", b =>
- {
- b.HasOne("AliasServerDb.Group", "OwnerGroup")
- .WithMany()
- .HasForeignKey("OwnerGroupId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("OwnerGroup");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>
- {
- b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")
- .WithMany()
- .HasForeignKey("UserGrantKeyId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("VaultManifestAccessKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
-
- b.Navigation("UserGrantKey");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")
- .WithMany()
- .HasForeignKey("VaultManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("VaultManifest");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>
- {
- b.HasOne("AliasServerDb.VaultManifest", "Manifest")
- .WithMany()
- .HasForeignKey("ManifestId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Manifest");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("VaultManifestAccessKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
-
- b.Navigation("DecryptionKeys");
-
- b.Navigation("Parts");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailClaim", b =>
- {
- b.Navigation("Links");
- });
-
- modelBuilder.Entity("AliasServerDb.Group", b =>
- {
- b.Navigation("Members");
- });
-
- modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>
- {
- b.Navigation("DecryptionKeys");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260822141154_WidenAuthLogRequestPath.cs b/apps/server/Databases/AliasServerDb/Migrations/20260822141154_WidenAuthLogRequestPath.cs
deleted file mode 100644
index c4e13ae53..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260822141154_WidenAuthLogRequestPath.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations
-{
- /// <inheritdoc />
- public partial class WidenAuthLogRequestPath : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AlterColumn<string>(
- name: "RequestPath",
- table: "AuthLogs",
- type: "character varying(255)",
- maxLength: 255,
- nullable: true,
- oldClrType: typeof(string),
- oldType: "character varying(100)",
- oldMaxLength: 100,
- oldNullable: true);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AlterColumn<string>(
- name: "RequestPath",
- table: "AuthLogs",
- type: "character varying(100)",
- maxLength: 100,
- nullable: true,
- oldClrType: typeof(string),
- oldType: "character varying(255)",
- oldMaxLength: 255,
- oldNullable: true);
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260822183612_AddGroupInvitationVaultKeyVersion.cs b/apps/server/Databases/AliasServerDb/Migrations/20260822183612_AddGroupInvitationVaultKeyVersion.cs
deleted file mode 100644
index 452f22ecf..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/20260822183612_AddGroupInvitationVaultKeyVersion.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations
-{
- /// <inheritdoc />
- public partial class AddGroupInvitationVaultKeyVersion : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<int>(
- name: "VaultKeyVersion",
- table: "GroupInvitations",
- type: "integer",
- nullable: false,
- defaultValue: 0);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "VaultKeyVersion",
- table: "GroupInvitations");
- }
- }
-}