1
0
mirror of https://github.com/bitwarden/server synced 2026-01-05 18:13:31 +00:00

[SM-206] Update sqlproject to match migrations (#2246)

This commit is contained in:
Oscar Hinton
2022-09-08 21:42:02 +02:00
committed by GitHub
parent d6ce41c837
commit 70f16bc069
13 changed files with 383 additions and 318 deletions

View File

@@ -0,0 +1,6 @@
CREATE VIEW [dbo].[OrganizationSponsorshipView]
AS
SELECT
*
FROM
[dbo].[OrganizationSponsorship]

View File

@@ -40,7 +40,7 @@ SELECT
OS.[ValidUntil] FamilySponsorshipValidUntil
FROM
[dbo].[OrganizationUser] OU
INNER JOIN
LEFT JOIN
[dbo].[Organization] O ON O.[Id] = OU.[OrganizationId]
LEFT JOIN
[dbo].[SsoUser] SU ON SU.[UserId] = OU.[UserId] AND SU.[OrganizationId] = OU.[OrganizationId]

View File

@@ -8,7 +8,10 @@ SELECT
PO.[Key],
PO.[Settings],
PO.[CreationDate],
PO.[RevisionDate]
PO.[RevisionDate],
(SELECT COUNT(1) FROM [dbo].[OrganizationUser] OU WHERE OU.OrganizationId = PO.OrganizationId AND OU.Status = 2) UserCount,
O.[Seats],
O.[Plan]
FROM
[dbo].[ProviderOrganization] PO
LEFT JOIN