mirror of
https://github.com/bitwarden/server.git
synced 2024-11-29 13:25:17 +01:00
27 lines
629 B
MySQL
27 lines
629 B
MySQL
|
--CipherOrganizationDetails_ReadByOrganizationId
|
||
|
IF OBJECT_ID('[dbo].[CipherOrganizationDetails_ReadByOrganizationId]') IS NOT NULL
|
||
|
BEGIN
|
||
|
DROP PROCEDURE [dbo].[CipherOrganizationDetails_ReadByOrganizationId]
|
||
|
END
|
||
|
GO
|
||
|
|
||
|
CREATE PROCEDURE [dbo].[CipherOrganizationDetails_ReadByOrganizationId]
|
||
|
@OrganizationId UNIQUEIDENTIFIER
|
||
|
AS
|
||
|
BEGIN
|
||
|
SET NOCOUNT ON
|
||
|
|
||
|
SELECT
|
||
|
C.*,
|
||
|
CASE
|
||
|
WHEN O.[UseTotp] = 1 THEN 1
|
||
|
ELSE 0
|
||
|
END [OrganizationUseTotp]
|
||
|
FROM
|
||
|
[dbo].[CipherView] C
|
||
|
LEFT JOIN
|
||
|
[dbo].[OrganizationView] O ON O.[Id] = C.[OrganizationId]
|
||
|
WHERE
|
||
|
C.[OrganizationId] = @OrganizationId
|
||
|
END
|
||
|
GO
|