mirror of
https://github.com/bitwarden/server
synced 2025-12-15 07:43:54 +00:00
PM-26966 added new metric columns to organization report table (#6486)
* PM-26966 added new metric columns to organization report table * PM-26966 fixing migration * PM-26966 fixing formatting issue. * PM-26966 updating unit tests * PM-26966 fixing SQL to read from view
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,137 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.PostgresMigrations.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class _20251028_00_AddOrganizationReportMetricColumns : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "ApplicationAtRiskCount",
|
||||
table: "OrganizationReport",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "ApplicationCount",
|
||||
table: "OrganizationReport",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "CriticalApplicationAtRiskCount",
|
||||
table: "OrganizationReport",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "CriticalApplicationCount",
|
||||
table: "OrganizationReport",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "CriticalMemberAtRiskCount",
|
||||
table: "OrganizationReport",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "CriticalMemberCount",
|
||||
table: "OrganizationReport",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "CriticalPasswordAtRiskCount",
|
||||
table: "OrganizationReport",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "CriticalPasswordCount",
|
||||
table: "OrganizationReport",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "MemberAtRiskCount",
|
||||
table: "OrganizationReport",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "MemberCount",
|
||||
table: "OrganizationReport",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "PasswordAtRiskCount",
|
||||
table: "OrganizationReport",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "PasswordCount",
|
||||
table: "OrganizationReport",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ApplicationAtRiskCount",
|
||||
table: "OrganizationReport");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ApplicationCount",
|
||||
table: "OrganizationReport");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CriticalApplicationAtRiskCount",
|
||||
table: "OrganizationReport");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CriticalApplicationCount",
|
||||
table: "OrganizationReport");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CriticalMemberAtRiskCount",
|
||||
table: "OrganizationReport");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CriticalMemberCount",
|
||||
table: "OrganizationReport");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CriticalPasswordAtRiskCount",
|
||||
table: "OrganizationReport");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CriticalPasswordCount",
|
||||
table: "OrganizationReport");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MemberAtRiskCount",
|
||||
table: "OrganizationReport");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MemberCount",
|
||||
table: "OrganizationReport");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PasswordAtRiskCount",
|
||||
table: "OrganizationReport");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PasswordCount",
|
||||
table: "OrganizationReport");
|
||||
}
|
||||
}
|
||||
@@ -1019,6 +1019,12 @@ namespace Bit.PostgresMigrations.Migrations
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int?>("ApplicationAtRiskCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("ApplicationCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("ApplicationData")
|
||||
.HasColumnType("text");
|
||||
|
||||
@@ -1029,9 +1035,39 @@ namespace Bit.PostgresMigrations.Migrations
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int?>("CriticalApplicationAtRiskCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("CriticalApplicationCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("CriticalMemberAtRiskCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("CriticalMemberCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("CriticalPasswordAtRiskCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("CriticalPasswordCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("MemberAtRiskCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("MemberCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<Guid>("OrganizationId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int?>("PasswordAtRiskCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("PasswordCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("ReportData")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
Reference in New Issue
Block a user