1
0
mirror of https://github.com/bitwarden/server.git synced 2025-01-22 21:51:22 +01:00

reimport database for formatting

This commit is contained in:
Kyle Spearrin 2017-04-25 10:55:12 -04:00
parent 6e87d9c21f
commit 8ade63fd45
16 changed files with 122 additions and 121 deletions

View File

@ -67,117 +67,117 @@
<Folder Include="dbo\User Defined Types\" />
</ItemGroup>
<ItemGroup>
<Build Include="dbo\Tables\Device.sql" />
<Build Include="dbo\Tables\Cipher.sql" />
<Build Include="dbo\Tables\Organization.sql" />
<Build Include="dbo\Tables\Grant.sql" />
<Build Include="dbo\Tables\Group.sql" />
<Build Include="dbo\Tables\User.sql" />
<Build Include="dbo\Tables\GroupUser.sql" />
<Build Include="dbo\Tables\Folder.sql" />
<Build Include="dbo\Tables\OrganizationUser.sql" />
<Build Include="dbo\Tables\Subvault.sql" />
<Build Include="dbo\Tables\SubvaultCipher.sql" />
<Build Include="dbo\Tables\SubvaultGroup.sql" />
<Build Include="dbo\Tables\SubvaultUser.sql" />
<Build Include="dbo\Views\SubvaultUserView.sql" />
<Build Include="dbo\Views\DeviceView.sql" />
<Build Include="dbo\Views\OrganizationView.sql" />
<Build Include="dbo\Views\FolderView.sql" />
<Build Include="dbo\Tables\User.sql" />
<Build Include="dbo\Tables\OrganizationUser.sql" />
<Build Include="dbo\Tables\Cipher.sql" />
<Build Include="dbo\Tables\Device.sql" />
<Build Include="dbo\Tables\Folder.sql" />
<Build Include="dbo\Tables\Grant.sql" />
<Build Include="dbo\Tables\Group.sql" />
<Build Include="dbo\Tables\GroupUser.sql" />
<Build Include="dbo\Tables\Organization.sql" />
<Build Include="dbo\Tables\Subvault.sql" />
<Build Include="dbo\Views\CipherView.sql" />
<Build Include="dbo\Views\OrganizationUserView.sql" />
<Build Include="dbo\Views\UserView.sql" />
<Build Include="dbo\Views\SubvaultUserSubvaultDetailsView.sql" />
<Build Include="dbo\Views\DeviceView.sql" />
<Build Include="dbo\Views\FolderView.sql" />
<Build Include="dbo\Views\GrantView.sql" />
<Build Include="dbo\Views\SubvaultUserUserDetailsView.sql" />
<Build Include="dbo\Views\OrganizationUserOrganizationDetailsView.sql" />
<Build Include="dbo\Views\OrganizationUserUserDetailsView.sql" />
<Build Include="dbo\Views\OrganizationUserView.sql" />
<Build Include="dbo\Views\OrganizationView.sql" />
<Build Include="dbo\Views\SubvaultUserSubvaultDetailsView.sql" />
<Build Include="dbo\Views\SubvaultUserUserDetailsView.sql" />
<Build Include="dbo\Views\SubvaultUserView.sql" />
<Build Include="dbo\Views\SubvaultView.sql" />
<Build Include="dbo\Views\UserView.sql" />
<Build Include="dbo\Functions\UserCanEditCipher.sql" />
<Build Include="dbo\Functions\CipherDetails.sql" />
<Build Include="dbo\Stored Procedures\SubvaultCipher_ReadByUserIdCipherId.sql" />
<Build Include="dbo\Stored Procedures\Subvault_ReadByOrganizationId.sql" />
<Build Include="dbo\Stored Procedures\SubvaultUser_ReadByOrganizationUserId.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_ReadCountByFreeOrganizationAdminUser.sql" />
<Build Include="dbo\Stored Procedures\Cipher_Create.sql" />
<Build Include="dbo\Stored Procedures\Cipher_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\Cipher_ReadById.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_ReadCountByOrganizationId.sql" />
<Build Include="dbo\Stored Procedures\Subvault_ReadCountByOrganizationId.sql" />
<Build Include="dbo\Stored Procedures\Folder_Create.sql" />
<Build Include="dbo\Stored Procedures\Folder_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\Folder_ReadById.sql" />
<Build Include="dbo\Stored Procedures\Cipher_Update.sql" />
<Build Include="dbo\Stored Procedures\Folder_Update.sql" />
<Build Include="dbo\Stored Procedures\Device_ClearPushTokenByIdentifier.sql" />
<Build Include="dbo\Stored Procedures\Device_Create.sql" />
<Build Include="dbo\Stored Procedures\Device_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\Organization_Create.sql" />
<Build Include="dbo\Stored Procedures\Device_ReadById.sql" />
<Build Include="dbo\Stored Procedures\Organization_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\Device_ReadByIdentifierUserId.sql" />
<Build Include="dbo\Stored Procedures\Organization_ReadById.sql" />
<Build Include="dbo\Stored Procedures\Device_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\CipherDetails_ReadByTypeUserId.sql" />
<Build Include="dbo\Stored Procedures\Organization_Update.sql" />
<Build Include="dbo\Stored Procedures\Device_Update.sql" />
<Build Include="dbo\Stored Procedures\CipherDetails_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_Create.sql" />
<Build Include="dbo\Stored Procedures\CipherDetails_ReadByUserIdHasSubvault.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\User_Create.sql" />
<Build Include="dbo\Stored Procedures\Folder_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_ReadById.sql" />
<Build Include="dbo\Stored Procedures\User_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\Subvault_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_Update.sql" />
<Build Include="dbo\Stored Procedures\User_ReadByEmail.sql" />
<Build Include="dbo\Stored Procedures\SubvaultCipher_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\Subvault_Create.sql" />
<Build Include="dbo\Stored Procedures\User_ReadById.sql" />
<Build Include="dbo\Stored Procedures\CipherDetails_Create.sql" />
<Build Include="dbo\Stored Procedures\Subvault_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\User_Update.sql" />
<Build Include="dbo\Stored Procedures\CipherDetails_Update.sql" />
<Build Include="dbo\Stored Procedures\Subvault_ReadById.sql" />
<Build Include="dbo\Stored Procedures\User_UpdateEmailPassword.sql" />
<Build Include="dbo\Stored Procedures\Subvault_Update.sql" />
<Build Include="dbo\Stored Procedures\SubvaultCipher_Create.sql" />
<Build Include="dbo\Stored Procedures\SubvaultCipher_Delete.sql" />
<Build Include="dbo\Stored Procedures\Cipher_UpdateWithSubvaults.sql" />
<Build Include="dbo\Stored Procedures\SubvaultUser_Create.sql" />
<Build Include="dbo\Stored Procedures\CipherDetails_ReadByIdUserId.sql" />
<Build Include="dbo\Stored Procedures\SubvaultUser_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_ReadByOrganizationIdUserId.sql" />
<Build Include="dbo\Stored Procedures\SubvaultUser_ReadById.sql" />
<Build Include="dbo\Stored Procedures\SubvaultCipher_UpdateSubvaults.sql" />
<Build Include="dbo\Stored Procedures\User_Update.sql" />
<Build Include="dbo\Stored Procedures\User_ReadPublicKeyById.sql" />
<Build Include="dbo\Stored Procedures\User_ReadById.sql" />
<Build Include="dbo\Stored Procedures\User_ReadByEmail.sql" />
<Build Include="dbo\Stored Procedures\User_ReadAccountRevisionDateById.sql" />
<Build Include="dbo\Stored Procedures\User_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\User_Create.sql" />
<Build Include="dbo\Stored Procedures\SubvaultUserUserDetails_ReadBySubvaultId.sql" />
<Build Include="dbo\Stored Procedures\SubvaultUserSubvaultDetails_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\SubvaultUser_Update.sql" />
<Build Include="dbo\Stored Procedures\CipherFullDetails_ReadByIdUserId.sql" />
<Build Include="dbo\Stored Procedures\SubvaultUser_ReadCanEditByCipherIdUserId.sql" />
<Build Include="dbo\Stored Procedures\Cipher_UpdatePartial.sql" />
<Build Include="dbo\Stored Procedures\SubvaultUser_ReadByOrganizationUserId.sql" />
<Build Include="dbo\Stored Procedures\SubvaultUser_ReadById.sql" />
<Build Include="dbo\Stored Procedures\SubvaultUser_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\SubvaultUser_Create.sql" />
<Build Include="dbo\Stored Procedures\SubvaultCipher_UpdateSubvaultsAdmin.sql" />
<Build Include="dbo\Stored Procedures\SubvaultCipher_UpdateSubvaults.sql" />
<Build Include="dbo\Stored Procedures\SubvaultCipher_ReadByUserIdCipherId.sql" />
<Build Include="dbo\Stored Procedures\SubvaultCipher_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\SubvaultCipher_ReadByOrganizationId.sql" />
<Build Include="dbo\Stored Procedures\SubvaultCipher_Delete.sql" />
<Build Include="dbo\Stored Procedures\SubvaultCipher_Create.sql" />
<Build Include="dbo\Stored Procedures\Subvault_Update.sql" />
<Build Include="dbo\Stored Procedures\Subvault_ReadCountByOrganizationId.sql" />
<Build Include="dbo\Stored Procedures\Subvault_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\Subvault_ReadByOrganizationId.sql" />
<Build Include="dbo\Stored Procedures\Subvault_ReadById.sql" />
<Build Include="dbo\Stored Procedures\Subvault_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\Subvault_Create.sql" />
<Build Include="dbo\Stored Procedures\User_BumpAccountRevisionDate.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUserUserDetails_ReadByOrganizationId.sql" />
<Build Include="dbo\Stored Procedures\User_BumpAccountRevisionDateByOrganizationId.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUserUserDetails_ReadById.sql" />
<Build Include="dbo\Stored Procedures\User_BumpAccountRevisionDateByOrganizationUserId.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUserOrganizationDetails_ReadByUserIdStatus.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_Update.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_ReadCountByOrganizationId.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_ReadCountByFreeOrganizationAdminUser.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_ReadByOrganizationIdUserId.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_ReadByOrganizationIdEmail.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_ReadByOrganizationId.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_ReadById.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_Create.sql" />
<Build Include="dbo\Stored Procedures\Organization_Update.sql" />
<Build Include="dbo\Stored Procedures\Organization_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\Grant_DeleteByKey.sql" />
<Build Include="dbo\Stored Procedures\SubvaultUserSubvaultDetails_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\Grant_DeleteBySubjectIdClientId.sql" />
<Build Include="dbo\Stored Procedures\SubvaultUserUserDetails_ReadBySubvaultId.sql" />
<Build Include="dbo\Stored Procedures\Grant_DeleteBySubjectIdClientIdType.sql" />
<Build Include="dbo\Stored Procedures\Grant_ReadByKey.sql" />
<Build Include="dbo\Stored Procedures\Grant_ReadBySubjectId.sql" />
<Build Include="dbo\Stored Procedures\Organization_ReadById.sql" />
<Build Include="dbo\Stored Procedures\Organization_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\Organization_Create.sql" />
<Build Include="dbo\Stored Procedures\Grant_Save.sql" />
<Build Include="dbo\Stored Procedures\User_ReadAccountRevisionDateById.sql" />
<Build Include="dbo\Stored Procedures\User_ReadPublicKeyById.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUserUserDetails_ReadById.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUserUserDetails_ReadByOrganizationId.sql" />
<Build Include="dbo\User Defined Types\GuidIdArray.sql" />
<Build Include="dbo\Stored Procedures\Grant_ReadBySubjectId.sql" />
<Build Include="dbo\Stored Procedures\Grant_ReadByKey.sql" />
<Build Include="dbo\Stored Procedures\Grant_DeleteBySubjectIdClientIdType.sql" />
<Build Include="dbo\Stored Procedures\Grant_DeleteBySubjectIdClientId.sql" />
<Build Include="dbo\Stored Procedures\Grant_DeleteByKey.sql" />
<Build Include="dbo\Stored Procedures\Folder_Update.sql" />
<Build Include="dbo\Stored Procedures\Folder_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\Folder_ReadById.sql" />
<Build Include="dbo\Stored Procedures\Folder_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\Folder_Create.sql" />
<Build Include="dbo\Stored Procedures\Device_Update.sql" />
<Build Include="dbo\Stored Procedures\Device_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\Device_ReadByIdentifierUserId.sql" />
<Build Include="dbo\Stored Procedures\Device_ReadById.sql" />
<Build Include="dbo\Stored Procedures\Device_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\Device_Create.sql" />
<Build Include="dbo\Stored Procedures\Device_ClearPushTokenByIdentifier.sql" />
<Build Include="dbo\Stored Procedures\CipherFullDetails_ReadByIdUserId.sql" />
<Build Include="dbo\Stored Procedures\CipherDetails_Update.sql" />
<Build Include="dbo\Stored Procedures\CipherDetails_ReadByUserIdHasSubvault.sql" />
<Build Include="dbo\Stored Procedures\CipherDetails_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\CipherDetails_ReadByTypeUserId.sql" />
<Build Include="dbo\Stored Procedures\CipherDetails_ReadByIdUserId.sql" />
<Build Include="dbo\Stored Procedures\CipherDetails_Create.sql" />
<Build Include="dbo\Stored Procedures\Cipher_UpdateWithSubvaults.sql" />
<Build Include="dbo\Stored Procedures\Cipher_UpdatePartial.sql" />
<Build Include="dbo\Stored Procedures\Cipher_Update.sql" />
<Build Include="dbo\Stored Procedures\Cipher_ReadByOrganizationId.sql" />
<Build Include="dbo\Stored Procedures\SubvaultCipher_ReadByOrganizationId.sql" />
<Build Include="dbo\Stored Procedures\SubvaultCipher_UpdateSubvaultsAdmin.sql" />
<Build Include="dbo\Stored Procedures\User_BumpAccountRevisionDate.sql" />
<Build Include="dbo\Stored Procedures\User_BumpAccountRevisionDateByOrganizationId.sql" />
<Build Include="dbo\Stored Procedures\User_BumpAccountRevisionDateByOrganizationUserId.sql" />
<Build Include="dbo\Stored Procedures\Cipher_ReadById.sql" />
<Build Include="dbo\Stored Procedures\Cipher_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\Cipher_Create.sql" />
<Build Include="dbo\User Defined Types\GuidIdArray.sql" />
</ItemGroup>
</Project>

View File

@ -21,4 +21,4 @@ SELECT
ELSE TRY_CONVERT(UNIQUEIDENTIFIER, JSON_VALUE(C.[Folders], CONCAT('$."', @UserId, '"')))
END [FolderId]
FROM
[dbo].[Cipher] C
[dbo].[Cipher] C

View File

@ -29,4 +29,4 @@ BEGIN
BEGIN
EXEC [dbo].[User_BumpAccountRevisionDate] @UserId
END
END
END

View File

@ -10,4 +10,4 @@ BEGIN
[dbo].[FolderView]
WHERE
[UserId] = @UserId
END
END

View File

@ -48,4 +48,4 @@ BEGIN
@CreationDate,
@RevisionDate
)
END
END

View File

@ -34,4 +34,4 @@ BEGIN
[RevisionDate] = @RevisionDate
WHERE
[Id] = @Id
END
END

View File

@ -10,4 +10,4 @@ BEGIN
[AccountRevisionDate] = GETUTCDATE()
WHERE
[Id] = @Id
END
END

View File

@ -15,4 +15,4 @@ BEGIN
WHERE
OU.[OrganizationId] = @OrganizationId
AND OU.[Status] = 2 -- Confirmed
END
END

View File

@ -15,4 +15,4 @@ BEGIN
WHERE
OU.[Id] = @OrganizationUserId
AND OU.[Status] = 2 -- Confirmed
END
END

View File

@ -36,4 +36,4 @@ BEGIN
[Id] = @Id
COMMIT TRANSACTION User_DeleteById
END
END

View File

@ -1,4 +1,5 @@
CREATE PROCEDURE [dbo].[User_ReadAccountRevisionDateById]

CREATE PROCEDURE [dbo].[User_ReadAccountRevisionDateById]
@Id UNIQUEIDENTIFIER
AS
BEGIN

View File

@ -22,4 +22,4 @@ BEGIN
[AccountRevisionDate] = @RevisionDate
WHERE
[Id] = @Id
END
END

View File

@ -14,11 +14,11 @@
GO
CREATE NONCLUSTERED INDEX [IX_Cipher_UserId_Type]
ON [dbo].[Cipher]([UserId] ASC, [Type] ASC);
CREATE NONCLUSTERED INDEX [IX_Cipher_OrganizationId_Type]
ON [dbo].[Cipher]([OrganizationId] ASC, [Type] ASC) WHERE ([OrganizationId] IS NOT NULL);
GO
CREATE NONCLUSTERED INDEX [IX_Cipher_OrganizationId_Type]
ON [dbo].[Cipher]([OrganizationId] ASC, [Type] ASC)
WHERE [OrganizationId] IS NOT NULL;
CREATE NONCLUSTERED INDEX [IX_Cipher_UserId_Type]
ON [dbo].[Cipher]([UserId] ASC, [Type] ASC);

View File

@ -1,14 +1,14 @@
CREATE TABLE [dbo].[OrganizationUser] (
[Id] UNIQUEIDENTIFIER NOT NULL,
[OrganizationId] UNIQUEIDENTIFIER NOT NULL,
[UserId] UNIQUEIDENTIFIER NULL,
[Email] NVARCHAR (50) NULL,
[Key] VARCHAR (MAX) NULL,
[Status] TINYINT NOT NULL,
[Type] TINYINT NOT NULL,
[AccessAllSubvaults] BIT NOT NULL,
[CreationDate] DATETIME2 (7) NOT NULL,
[RevisionDate] DATETIME2 (7) NOT NULL,
[Id] UNIQUEIDENTIFIER NOT NULL,
[OrganizationId] UNIQUEIDENTIFIER NOT NULL,
[UserId] UNIQUEIDENTIFIER NULL,
[Email] NVARCHAR (50) NULL,
[Key] VARCHAR (MAX) NULL,
[Status] TINYINT NOT NULL,
[Type] TINYINT NOT NULL,
[AccessAllSubvaults] BIT NOT NULL,
[CreationDate] DATETIME2 (7) NOT NULL,
[RevisionDate] DATETIME2 (7) NOT NULL,
CONSTRAINT [PK_OrganizationUser] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_OrganizationUser_Organization] FOREIGN KEY ([OrganizationId]) REFERENCES [dbo].[Organization] ([Id]) ON DELETE CASCADE,
CONSTRAINT [FK_OrganizationUser_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([Id])

View File

@ -3,4 +3,4 @@ AS
SELECT
*
FROM
[dbo].[Folder]
[dbo].[Folder]

View File

@ -3,4 +3,4 @@ AS
SELECT
*
FROM
[dbo].[User]
[dbo].[User]