CREATE VIEW [dbo].[UserView]
AS
SELECT
    [Id],
    [Name],
    [Email],
    [EmailVerified],
    [MasterPassword],
    [MasterPasswordHint],
    [Culture],
    [SecurityStamp],
    [TwoFactorProviders],
    [TwoFactorRecoveryCode],
    [EquivalentDomains],
    [ExcludedGlobalEquivalentDomains],
    [AccountRevisionDate],
    [Key],
    [PublicKey],
    [PrivateKey],
    [Premium],
    [PremiumExpirationDate],
    [RenewalReminderDate],
    [Storage],
    COALESCE([MaxStorageGbIncreased], [MaxStorageGb]) AS [MaxStorageGb],
    [Gateway],
    [GatewayCustomerId],
    [GatewaySubscriptionId],
    [ReferenceData],
    [LicenseKey],
    [ApiKey],
    [Kdf],
    [KdfIterations],
    [KdfMemory],
    [KdfParallelism],
    [CreationDate],
    [RevisionDate],
    [ForcePasswordReset],
    [UsesKeyConnector],
    [FailedLoginCount],
    [LastFailedLoginDate],
    [AvatarColor],
    [LastPasswordChangeDate],
    [LastKdfChangeDate],
    [LastKeyRotationDate],
    [LastEmailChangeDate],
    [VerifyDevices],
    [SecurityState],
    [SecurityVersion],
    [SignedPublicKey]
FROM
    [dbo].[User]
