mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 08:32:50 -05:00
Merge branch 'main' into auth/pm-20348/extension-auth-approvals-add-auth-request-endpoint
This commit is contained in:
@ -0,0 +1,70 @@
|
||||
CREATE OR ALTER PROC dbo.MemberAccessReport_GetMemberAccessCipherDetailsByOrganizationId
|
||||
@OrganizationId UNIQUEIDENTIFIER
|
||||
AS
|
||||
SET NOCOUNT ON;
|
||||
|
||||
IF @OrganizationId IS NULL
|
||||
THROW 50000, 'OrganizationId cannot be null', 1;
|
||||
|
||||
SELECT
|
||||
U.Id AS UserGuid,
|
||||
U.Name AS UserName,
|
||||
U.Email,
|
||||
U.TwoFactorProviders,
|
||||
U.UsesKeyConnector,
|
||||
OU.ResetPasswordKey,
|
||||
CC.CollectionId,
|
||||
C.Name AS CollectionName,
|
||||
NULL AS GroupId,
|
||||
NULL AS GroupName,
|
||||
CU.ReadOnly,
|
||||
CU.HidePasswords,
|
||||
CU.Manage,
|
||||
Cipher.Id AS CipherId
|
||||
FROM dbo.OrganizationUser OU
|
||||
INNER JOIN dbo.[User] U ON U.Id = OU.UserId
|
||||
INNER JOIN dbo.Organization O ON O.Id = OU.OrganizationId
|
||||
AND O.Id = @OrganizationId
|
||||
AND O.Enabled = 1
|
||||
INNER JOIN dbo.CollectionUser CU ON CU.OrganizationUserId = OU.Id
|
||||
INNER JOIN dbo.Collection C ON C.Id = CU.CollectionId
|
||||
INNER JOIN dbo.CollectionCipher CC ON CC.CollectionId = C.Id
|
||||
INNER JOIN dbo.Cipher Cipher ON Cipher.Id = CC.CipherId
|
||||
AND Cipher.OrganizationId = @OrganizationId
|
||||
WHERE OU.Status in (0,1,2)
|
||||
AND Cipher.DeletedDate IS NULL
|
||||
|
||||
UNION ALL
|
||||
|
||||
-- Group-based collection permissions
|
||||
SELECT
|
||||
U.Id AS UserGuid,
|
||||
U.Name AS UserName,
|
||||
U.Email,
|
||||
U.TwoFactorProviders,
|
||||
U.UsesKeyConnector,
|
||||
OU.ResetPasswordKey,
|
||||
CC.CollectionId,
|
||||
C.Name AS CollectionName,
|
||||
G.Id AS GroupId,
|
||||
G.Name AS GroupName,
|
||||
CG.ReadOnly,
|
||||
CG.HidePasswords,
|
||||
CG.Manage,
|
||||
Cipher.Id AS CipherId
|
||||
FROM dbo.OrganizationUser OU
|
||||
INNER JOIN dbo.[User] U ON U.Id = OU.UserId
|
||||
INNER JOIN dbo.Organization O ON O.Id = OU.OrganizationId
|
||||
AND O.Id = @OrganizationId
|
||||
AND O.Enabled = 1
|
||||
INNER JOIN dbo.GroupUser GU ON GU.OrganizationUserId = OU.Id
|
||||
INNER JOIN dbo.[Group] G ON G.Id = GU.GroupId
|
||||
INNER JOIN dbo.CollectionGroup CG ON CG.GroupId = G.Id
|
||||
INNER JOIN dbo.Collection C ON C.Id = CG.CollectionId
|
||||
INNER JOIN dbo.CollectionCipher CC ON CC.CollectionId = C.Id
|
||||
INNER JOIN dbo.Cipher Cipher ON Cipher.Id = CC.CipherId
|
||||
AND Cipher.OrganizationId = @OrganizationId
|
||||
WHERE OU.Status in (0,1,2)
|
||||
AND Cipher.DeletedDate IS NULL
|
||||
|
||||
GO
|
@ -0,0 +1,94 @@
|
||||
CREATE OR ALTER PROC dbo.MemberAccessReport_GetMemberAccessCipherDetailsByOrganizationId
|
||||
@OrganizationId UNIQUEIDENTIFIER
|
||||
AS
|
||||
SET NOCOUNT ON;
|
||||
|
||||
IF @OrganizationId IS NULL
|
||||
THROW 50000, 'OrganizationId cannot be null', 1;
|
||||
|
||||
SELECT
|
||||
OU.Id AS UserGuid,
|
||||
U.Name AS UserName,
|
||||
ISNULL(U.Email, OU.Email) as 'Email',
|
||||
U.TwoFactorProviders,
|
||||
U.UsesKeyConnector,
|
||||
OU.ResetPasswordKey,
|
||||
CC.CollectionId,
|
||||
C.Name AS CollectionName,
|
||||
NULL AS GroupId,
|
||||
NULL AS GroupName,
|
||||
CU.ReadOnly,
|
||||
CU.HidePasswords,
|
||||
CU.Manage,
|
||||
Cipher.Id AS CipherId
|
||||
FROM dbo.OrganizationUser OU
|
||||
LEFT JOIN dbo.[User] U ON U.Id = OU.UserId
|
||||
INNER JOIN dbo.Organization O ON O.Id = OU.OrganizationId
|
||||
AND O.Id = @OrganizationId
|
||||
AND O.Enabled = 1
|
||||
INNER JOIN dbo.CollectionUser CU ON CU.OrganizationUserId = OU.Id
|
||||
INNER JOIN dbo.Collection C ON C.Id = CU.CollectionId and C.OrganizationId = @OrganizationId
|
||||
INNER JOIN dbo.CollectionCipher CC ON CC.CollectionId = C.Id
|
||||
INNER JOIN dbo.Cipher Cipher ON Cipher.Id = CC.CipherId AND Cipher.OrganizationId = @OrganizationId
|
||||
WHERE OU.Status IN (0,1,2) -- Invited, Accepted and Confirmed Users
|
||||
AND Cipher.DeletedDate IS NULL
|
||||
UNION ALL
|
||||
-- Group-based collection permissions
|
||||
SELECT
|
||||
OU.Id AS UserGuid,
|
||||
U.Name AS UserName,
|
||||
ISNULL(U.Email, OU.Email) as 'Email',
|
||||
U.TwoFactorProviders,
|
||||
U.UsesKeyConnector,
|
||||
OU.ResetPasswordKey,
|
||||
CC.CollectionId,
|
||||
C.Name AS CollectionName,
|
||||
G.Id AS GroupId,
|
||||
G.Name AS GroupName,
|
||||
CG.ReadOnly,
|
||||
CG.HidePasswords,
|
||||
CG.Manage,
|
||||
Cipher.Id AS CipherId
|
||||
FROM dbo.OrganizationUser OU
|
||||
LEFT JOIN dbo.[User] U ON U.Id = OU.UserId
|
||||
INNER JOIN dbo.Organization O ON O.Id = OU.OrganizationId
|
||||
AND O.Id = @OrganizationId
|
||||
AND O.Enabled = 1
|
||||
INNER JOIN dbo.GroupUser GU ON GU.OrganizationUserId = OU.Id
|
||||
INNER JOIN dbo.[Group] G ON G.Id = GU.GroupId
|
||||
INNER JOIN dbo.CollectionGroup CG ON CG.GroupId = G.Id
|
||||
INNER JOIN dbo.Collection C ON C.Id = CG.CollectionId AND C.OrganizationId = @OrganizationId
|
||||
INNER JOIN dbo.CollectionCipher CC ON CC.CollectionId = C.Id
|
||||
INNER JOIN dbo.Cipher Cipher ON Cipher.Id = CC.CipherId and Cipher.OrganizationId = @OrganizationId
|
||||
WHERE OU.Status IN (0,1,2) -- Invited, Accepted and Confirmed Users
|
||||
AND Cipher.DeletedDate IS NULL
|
||||
UNION ALL
|
||||
-- Users without collection access (invited users)
|
||||
-- typically invited users who have not yet accepted the invitation
|
||||
-- and not yet assigned to any collection
|
||||
SELECT
|
||||
OU.Id AS UserGuid,
|
||||
U.Name AS UserName,
|
||||
ISNULL(U.Email, OU.Email) as 'Email',
|
||||
U.TwoFactorProviders,
|
||||
U.UsesKeyConnector,
|
||||
OU.ResetPasswordKey,
|
||||
null as CollectionId,
|
||||
null AS CollectionName,
|
||||
NULL AS GroupId,
|
||||
NULL AS GroupName,
|
||||
null as [ReadOnly],
|
||||
null as HidePasswords,
|
||||
null as Manage,
|
||||
null AS CipherId
|
||||
FROM dbo.OrganizationUser OU
|
||||
LEFT JOIN dbo.[User] U ON U.Id = OU.UserId
|
||||
INNER JOIN dbo.Organization O ON O.Id = OU.OrganizationId AND O.Id = @OrganizationId AND O.Enabled = 1
|
||||
WHERE OU.Status IN (0,1,2) -- Invited, Accepted and Confirmed Users
|
||||
AND OU.Id not in (
|
||||
select OU1.Id from dbo.OrganizationUser OU1
|
||||
inner join dbo.CollectionUser CU1 on CU1.OrganizationUserId = OU1.Id
|
||||
WHERE OU1.OrganizationId = @organizationId
|
||||
)
|
||||
|
||||
GO
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,50 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.MySqlMigrations.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: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
UserName = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Email = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
TwoFactorProviders = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
UsesKeyConnector = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
ResetPasswordKey = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CollectionId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
GroupId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
GroupName = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CollectionName = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
ReadOnly = table.Column<bool>(type: "tinyint(1)", nullable: true),
|
||||
HidePasswords = table.Column<bool>(type: "tinyint(1)", nullable: true),
|
||||
Manage = table.Column<bool>(type: "tinyint(1)", nullable: true),
|
||||
CipherId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "OrganizationMemberBaseDetails");
|
||||
}
|
||||
}
|
@ -22,6 +22,53 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
|
||||
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Bit.Core.Dirt.Reports.Models.Data.OrganizationMemberBaseDetail", b =>
|
||||
{
|
||||
b.Property<Guid>("CipherId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<Guid?>("CollectionId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("CollectionName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("GroupId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("GroupName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool?>("HidePasswords")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<bool?>("Manage")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<bool?>("ReadOnly")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("ResetPasswordKey")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("TwoFactorProviders")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("UserGuid")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("UsesKeyConnector")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.ToTable("OrganizationMemberBaseDetails");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@ -920,6 +967,34 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
b.ToTable("ProviderPlan", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Dirt.Models.PasswordHealthReportApplication", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<Guid>("OrganizationId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTime>("RevisionDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Uri")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
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")
|
||||
@ -2023,34 +2098,6 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
b.ToTable("ServiceAccount", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Tools.Models.PasswordHealthReportApplication", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<Guid>("OrganizationId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTime>("RevisionDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Uri")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
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")
|
||||
@ -2532,6 +2579,17 @@ namespace Bit.MySqlMigrations.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")
|
||||
@ -2825,17 +2883,6 @@ namespace Bit.MySqlMigrations.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")
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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");
|
||||
}
|
||||
}
|
@ -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")
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,43 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.SqliteMigrations.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: "TEXT", 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: "INTEGER", nullable: false),
|
||||
ResetPasswordKey = table.Column<string>(type: "TEXT", nullable: true),
|
||||
CollectionId = table.Column<Guid>(type: "TEXT", nullable: true),
|
||||
GroupId = table.Column<Guid>(type: "TEXT", nullable: true),
|
||||
GroupName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
CollectionName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
ReadOnly = table.Column<bool>(type: "INTEGER", nullable: true),
|
||||
HidePasswords = table.Column<bool>(type: "INTEGER", nullable: true),
|
||||
Manage = table.Column<bool>(type: "INTEGER", nullable: true),
|
||||
CipherId = table.Column<Guid>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "OrganizationMemberBaseDetails");
|
||||
}
|
||||
}
|
@ -17,6 +17,53 @@ namespace Bit.SqliteMigrations.Migrations
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.8");
|
||||
|
||||
modelBuilder.Entity("Bit.Core.Dirt.Reports.Models.Data.OrganizationMemberBaseDetail", b =>
|
||||
{
|
||||
b.Property<Guid>("CipherId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid?>("CollectionId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CollectionName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid?>("GroupId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("GroupName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool?>("HidePasswords")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool?>("Manage")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool?>("ReadOnly")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ResetPasswordKey")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("TwoFactorProviders")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid?>("UserGuid")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("UsesKeyConnector")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.ToTable("OrganizationMemberBaseDetails");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@ -909,6 +956,34 @@ namespace Bit.SqliteMigrations.Migrations
|
||||
b.ToTable("ProviderPlan", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Dirt.Models.PasswordHealthReportApplication", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid>("OrganizationId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("RevisionDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
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")
|
||||
@ -2012,34 +2087,6 @@ namespace Bit.SqliteMigrations.Migrations
|
||||
b.ToTable("ServiceAccount", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Tools.Models.PasswordHealthReportApplication", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid>("OrganizationId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("RevisionDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
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")
|
||||
@ -2521,6 +2568,17 @@ namespace Bit.SqliteMigrations.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")
|
||||
@ -2814,17 +2872,6 @@ namespace Bit.SqliteMigrations.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")
|
||||
|
Reference in New Issue
Block a user