mirror of
https://github.com/bitwarden/server.git
synced 2025-07-13 13:47:30 -05:00

* PM-23030 adding migration script * PM-23030 fixing store procedure sql file * PM-23030 fixing syntax error * PM-23030 fixing migration * PM-23030 fixing sql script * PM-23030 fixing migration order * PM_23030 fixing migrations * PM-23030 fixing migration script validation error * PM-23030 fixing migration * PM-23030 trying to fix validation error * PM-23030 fixing migration script * PM-23030 updating sql scripts to change data type * PM-23030 adding report key to organization application * PM-23030 adding report key migration scripts * PM-23030 adding migration scripts * PM-23030 changing key column name
45 lines
974 B
Transact-SQL
45 lines
974 B
Transact-SQL
IF COL_LENGTH('[dbo].[OrganizationApplication]', 'ContentEncryptionKey') IS NULL
|
|
BEGIN
|
|
ALTER TABLE [dbo].[OrganizationApplication]
|
|
ADD [ContentEncryptionKey] VARCHAR(MAX) NOT NULL;
|
|
END
|
|
GO
|
|
|
|
CREATE OR ALTER VIEW [dbo].[OrganizationApplicationView]
|
|
AS
|
|
SELECT
|
|
*
|
|
FROM
|
|
[dbo].[OrganizationApplication]
|
|
GO
|
|
|
|
CREATE OR ALTER PROCEDURE [dbo].[OrganizationApplication_Create]
|
|
@Id UNIQUEIDENTIFIER OUTPUT,
|
|
@OrganizationId UNIQUEIDENTIFIER,
|
|
@Applications NVARCHAR(MAX),
|
|
@CreationDate DATETIME2(7),
|
|
@RevisionDate DATETIME2(7),
|
|
@ContentEncryptionKey VARCHAR(MAX)
|
|
AS
|
|
SET NOCOUNT ON;
|
|
|
|
INSERT INTO [dbo].[OrganizationApplication]
|
|
(
|
|
[Id],
|
|
[OrganizationId],
|
|
[Applications],
|
|
[CreationDate],
|
|
[RevisionDate],
|
|
[ContentEncryptionKey]
|
|
)
|
|
VALUES
|
|
(
|
|
@Id,
|
|
@OrganizationId,
|
|
@Applications,
|
|
@CreationDate,
|
|
@RevisionDate,
|
|
@ContentEncryptionKey
|
|
);
|
|
GO
|