mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 13:08:17 -05:00

* Add new columns to `dbo.Organization` & its references * Feed existing data into new `dbo.Organization` column * Update Entity Framework database definitions * Move new EF columns out of the core entity definition * Generate Entity Framework migrations * Feed existing data into new `Organization` Entity Framework columns * Add a where clause to SQL migration
67 lines
1.9 KiB
Transact-SQL
67 lines
1.9 KiB
Transact-SQL
CREATE VIEW [dbo].[OrganizationUserOrganizationDetailsView]
|
|
AS
|
|
SELECT
|
|
OU.[UserId],
|
|
OU.[OrganizationId],
|
|
OU.[Id] OrganizationUserId,
|
|
O.[Name],
|
|
O.[Enabled],
|
|
O.[PlanType],
|
|
O.[UsePolicies],
|
|
O.[UseSso],
|
|
O.[UseKeyConnector],
|
|
O.[UseScim],
|
|
O.[UseGroups],
|
|
O.[UseDirectory],
|
|
O.[UseEvents],
|
|
O.[UseTotp],
|
|
O.[Use2fa],
|
|
O.[UseApi],
|
|
O.[UseResetPassword],
|
|
O.[SelfHost],
|
|
O.[UsersGetPremium],
|
|
O.[UseCustomPermissions],
|
|
O.[UseSecretsManager],
|
|
O.[Seats],
|
|
O.[MaxCollections],
|
|
O.[MaxStorageGb],
|
|
O.[Identifier],
|
|
OU.[Key],
|
|
OU.[ResetPasswordKey],
|
|
O.[PublicKey],
|
|
O.[PrivateKey],
|
|
OU.[Status],
|
|
OU.[Type],
|
|
SU.[ExternalId] SsoExternalId,
|
|
OU.[Permissions],
|
|
PO.[ProviderId],
|
|
P.[Name] ProviderName,
|
|
P.[Type] ProviderType,
|
|
SS.[Data] SsoConfig,
|
|
OS.[FriendlyName] FamilySponsorshipFriendlyName,
|
|
OS.[LastSyncDate] FamilySponsorshipLastSyncDate,
|
|
OS.[ToDelete] FamilySponsorshipToDelete,
|
|
OS.[ValidUntil] FamilySponsorshipValidUntil,
|
|
OU.[AccessSecretsManager],
|
|
O.[UsePasswordManager],
|
|
O.[SmSeats],
|
|
O.[SmServiceAccounts],
|
|
O.[LimitCollectionCreationDeletion], -- Deprecated https://bitwarden.atlassian.net/browse/PM-10863
|
|
O.[LimitCollectionCreation],
|
|
O.[LimitCollectionDeletion],
|
|
O.[AllowAdminAccessToAllCollectionItems]
|
|
FROM
|
|
[dbo].[OrganizationUser] OU
|
|
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]
|
|
LEFT JOIN
|
|
[dbo].[ProviderOrganization] PO ON PO.[OrganizationId] = O.[Id]
|
|
LEFT JOIN
|
|
[dbo].[Provider] P ON P.[Id] = PO.[ProviderId]
|
|
LEFT JOIN
|
|
[dbo].[SsoConfig] SS ON SS.[OrganizationId] = OU.[OrganizationId]
|
|
LEFT JOIN
|
|
[dbo].[OrganizationSponsorship] OS ON OS.[SponsoringOrganizationUserID] = OU.[Id]
|