1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

[PM-20112] Member access stored proc and splitting the query (#5943)

This commit is contained in:
Tom
2025-06-16 17:32:36 -04:00
committed by GitHub
parent 66d1c70dc6
commit b8244908ec
32 changed files with 10480 additions and 347 deletions

View File

@ -0,0 +1,43 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.PostgresMigrations.Migrations;
/// <inheritdoc />
public partial class _20250609_00_AddMemberAccessReportStoreProceduresql : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "OrganizationMemberBaseDetails",
columns: table => new
{
UserGuid = table.Column<Guid>(type: "uuid", nullable: true),
UserName = table.Column<string>(type: "text", nullable: true),
Email = table.Column<string>(type: "text", nullable: true),
TwoFactorProviders = table.Column<string>(type: "text", nullable: true),
UsesKeyConnector = table.Column<bool>(type: "boolean", nullable: false),
ResetPasswordKey = table.Column<string>(type: "text", nullable: true),
CollectionId = table.Column<Guid>(type: "uuid", nullable: true),
GroupId = table.Column<Guid>(type: "uuid", nullable: true),
GroupName = table.Column<string>(type: "text", nullable: true),
CollectionName = table.Column<string>(type: "text", nullable: true),
ReadOnly = table.Column<bool>(type: "boolean", nullable: true),
HidePasswords = table.Column<bool>(type: "boolean", nullable: true),
Manage = table.Column<bool>(type: "boolean", nullable: true),
CipherId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "OrganizationMemberBaseDetails");
}
}

View File

@ -23,6 +23,53 @@ namespace Bit.PostgresMigrations.Migrations
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Bit.Core.Dirt.Reports.Models.Data.OrganizationMemberBaseDetail", b =>
{
b.Property<Guid>("CipherId")
.HasColumnType("uuid");
b.Property<Guid?>("CollectionId")
.HasColumnType("uuid");
b.Property<string>("CollectionName")
.HasColumnType("text");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<Guid?>("GroupId")
.HasColumnType("uuid");
b.Property<string>("GroupName")
.HasColumnType("text");
b.Property<bool?>("HidePasswords")
.HasColumnType("boolean");
b.Property<bool?>("Manage")
.HasColumnType("boolean");
b.Property<bool?>("ReadOnly")
.HasColumnType("boolean");
b.Property<string>("ResetPasswordKey")
.HasColumnType("text");
b.Property<string>("TwoFactorProviders")
.HasColumnType("text");
b.Property<Guid?>("UserGuid")
.HasColumnType("uuid");
b.Property<string>("UserName")
.HasColumnType("text");
b.Property<bool>("UsesKeyConnector")
.HasColumnType("boolean");
b.ToTable("OrganizationMemberBaseDetails");
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b =>
{
b.Property<Guid>("Id")
@ -925,6 +972,34 @@ namespace Bit.PostgresMigrations.Migrations
b.ToTable("ProviderPlan", (string)null);
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Dirt.Models.PasswordHealthReportApplication", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("OrganizationId")
.HasColumnType("uuid");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Uri")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Id")
.HasAnnotation("SqlServer:Clustered", true);
b.HasIndex("OrganizationId")
.HasAnnotation("SqlServer:Clustered", false);
b.ToTable("PasswordHealthReportApplication", (string)null);
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Cache", b =>
{
b.Property<string>("Id")
@ -2029,34 +2104,6 @@ namespace Bit.PostgresMigrations.Migrations
b.ToTable("ServiceAccount", (string)null);
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Tools.Models.PasswordHealthReportApplication", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("OrganizationId")
.HasColumnType("uuid");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Uri")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Id")
.HasAnnotation("SqlServer:Clustered", true);
b.HasIndex("OrganizationId")
.HasAnnotation("SqlServer:Clustered", false);
b.ToTable("PasswordHealthReportApplication", (string)null);
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Cipher", b =>
{
b.Property<Guid>("Id")
@ -2538,6 +2585,17 @@ namespace Bit.PostgresMigrations.Migrations
b.Navigation("Provider");
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Dirt.Models.PasswordHealthReportApplication", b =>
{
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", "Organization")
.WithMany()
.HasForeignKey("OrganizationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Organization");
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Collection", b =>
{
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", "Organization")
@ -2831,17 +2889,6 @@ namespace Bit.PostgresMigrations.Migrations
b.Navigation("Organization");
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Tools.Models.PasswordHealthReportApplication", b =>
{
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", "Organization")
.WithMany()
.HasForeignKey("OrganizationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Organization");
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Cipher", b =>
{
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", "Organization")