mirror of
https://github.com/bitwarden/server.git
synced 2024-11-24 12:35:25 +01:00
40 lines
920 B
MySQL
40 lines
920 B
MySQL
|
IF EXISTS(SELECT * FROM sys.views WHERE [Name] = 'OrganizationUserOrganizationDetailsView')
|
||
|
BEGIN
|
||
|
DROP VIEW [dbo].[OrganizationUserOrganizationDetailsView];
|
||
|
END
|
||
|
GO
|
||
|
|
||
|
CREATE VIEW [dbo].[OrganizationUserOrganizationDetailsView]
|
||
|
AS
|
||
|
SELECT
|
||
|
OU.[UserId],
|
||
|
OU.[OrganizationId],
|
||
|
O.[Name],
|
||
|
O.[Enabled],
|
||
|
O.[UsePolicies],
|
||
|
O.[UseSso],
|
||
|
O.[UseGroups],
|
||
|
O.[UseDirectory],
|
||
|
O.[UseEvents],
|
||
|
O.[UseTotp],
|
||
|
O.[Use2fa],
|
||
|
O.[UseApi],
|
||
|
O.[SelfHost],
|
||
|
O.[UsersGetPremium],
|
||
|
O.[Seats],
|
||
|
O.[MaxCollections],
|
||
|
O.[MaxStorageGb],
|
||
|
O.[Identifier],
|
||
|
OU.[Key],
|
||
|
OU.[Status],
|
||
|
OU.[Type],
|
||
|
SU.[ExternalId] SsoExternalId
|
||
|
FROM
|
||
|
[dbo].[OrganizationUser] OU
|
||
|
INNER JOIN
|
||
|
[dbo].[Organization] O ON O.[Id] = OU.[OrganizationId]
|
||
|
LEFT JOIN
|
||
|
[dbo].[SsoUser] SU ON SU.[UserId] = OU.[UserId] AND SU.[OrganizationId] = OU.[OrganizationId]
|
||
|
|
||
|
GO
|