1
0
mirror of https://github.com/bitwarden/server synced 2025-12-10 21:33:41 +00:00

[SM-1591] Adding SecretVersion table to server (#6406)

* Adding SecretVersion table to server

* making the names singular not plural for new table

* removing migration

* fixing migration

* Adding indexes for serviceacct and orguserId

* indexes for sqllite

* fixing migrations

* adding indexes to secretVeriosn.sql

* tests

* removing tests

* adding GO
This commit is contained in:
cd-bitwarden
2025-10-16 15:35:14 -04:00
committed by GitHub
parent 449603d180
commit 2965b499e9
16 changed files with 10640 additions and 0 deletions

View File

@@ -2148,6 +2148,42 @@ namespace Bit.SqliteMigrations.Migrations
b.ToTable("Secret", (string)null);
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.SecretVersion", b =>
{
b.Property<Guid>("Id")
.HasColumnType("TEXT");
b.Property<Guid?>("EditorOrganizationUserId")
.HasColumnType("TEXT");
b.Property<Guid?>("EditorServiceAccountId")
.HasColumnType("TEXT");
b.Property<Guid>("SecretId")
.HasColumnType("TEXT");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("TEXT");
b.Property<DateTime>("VersionDate")
.HasColumnType("TEXT");
b.HasKey("Id")
.HasAnnotation("SqlServer:Clustered", true);
b.HasIndex("EditorOrganizationUserId")
.HasDatabaseName("IX_SecretVersion_EditorOrganizationUserId");
b.HasIndex("EditorServiceAccountId")
.HasDatabaseName("IX_SecretVersion_EditorServiceAccountId");
b.HasIndex("SecretId")
.HasDatabaseName("IX_SecretVersion_SecretId");
b.ToTable("SecretVersion");
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", b =>
{
b.Property<Guid>("Id")
@@ -2973,6 +3009,31 @@ namespace Bit.SqliteMigrations.Migrations
b.Navigation("Organization");
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.SecretVersion", b =>
{
b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "EditorOrganizationUser")
.WithMany()
.HasForeignKey("EditorOrganizationUserId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "EditorServiceAccount")
.WithMany()
.HasForeignKey("EditorServiceAccountId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Secret", "Secret")
.WithMany("SecretVersions")
.HasForeignKey("SecretId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("EditorOrganizationUser");
b.Navigation("EditorServiceAccount");
b.Navigation("Secret");
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", b =>
{
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", "Organization")
@@ -3244,6 +3305,8 @@ namespace Bit.SqliteMigrations.Migrations
{
b.Navigation("GroupAccessPolicies");
b.Navigation("SecretVersions");
b.Navigation("ServiceAccountAccessPolicies");
b.Navigation("UserAccessPolicies");