mirror of
https://github.com/bitwarden/server.git
synced 2026-01-31 14:13:18 +08:00
45 lines
918 B
MySQL
45 lines
918 B
MySQL
|
|
IF COL_LENGTH('[dbo].[OrganizationReport]', 'ContentEncryptionKey') IS NULL
|
||
|
|
BEGIN
|
||
|
|
ALTER TABLE [dbo].[OrganizationReport]
|
||
|
|
ADD [ContentEncryptionKey] VARCHAR(MAX) NOT NULL;
|
||
|
|
END
|
||
|
|
GO
|
||
|
|
|
||
|
|
CREATE OR ALTER VIEW [dbo].[OrganizationReportView]
|
||
|
|
AS
|
||
|
|
SELECT
|
||
|
|
*
|
||
|
|
FROM
|
||
|
|
[dbo].[OrganizationReport]
|
||
|
|
GO
|
||
|
|
|
||
|
|
CREATE OR ALTER PROCEDURE [dbo].[OrganizationReport_Create]
|
||
|
|
@Id UNIQUEIDENTIFIER OUTPUT,
|
||
|
|
@OrganizationId UNIQUEIDENTIFIER,
|
||
|
|
@Date DATETIME2(7),
|
||
|
|
@ReportData NVARCHAR(MAX),
|
||
|
|
@CreationDate DATETIME2(7),
|
||
|
|
@ContentEncryptionKey VARCHAR(MAX)
|
||
|
|
AS
|
||
|
|
SET NOCOUNT ON;
|
||
|
|
|
||
|
|
INSERT INTO [dbo].[OrganizationReport]
|
||
|
|
(
|
||
|
|
[Id],
|
||
|
|
[OrganizationId],
|
||
|
|
[Date],
|
||
|
|
[ReportData],
|
||
|
|
[CreationDate],
|
||
|
|
[ContentEncryptionKey]
|
||
|
|
)
|
||
|
|
VALUES
|
||
|
|
(
|
||
|
|
@Id,
|
||
|
|
@OrganizationId,
|
||
|
|
@Date,
|
||
|
|
@ReportData,
|
||
|
|
@CreationDate,
|
||
|
|
@ContentEncryptionKey
|
||
|
|
);
|
||
|
|
GO
|