1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-06 05:28:15 -05:00
bitwarden/util/Migrator/DbScripts/2020-06-23_00_OrgIdentifier.sql
2020-06-24 12:24:36 -04:00

20 lines
484 B
Transact-SQL

IF COL_LENGTH('[dbo].[Organization]', 'Identifier') IS NULL
BEGIN
ALTER TABLE
[dbo].[Organization]
ADD
[Identifier] NVARCHAR (50) NULL
END
GO
IF NOT EXISTS (
SELECT * FROM sys.indexes WHERE [Name]='IX_Organization_Identifier'
AND object_id = OBJECT_ID('[dbo].[Organization]')
)
BEGIN
CREATE UNIQUE NONCLUSTERED INDEX [IX_Organization_Identifier]
ON [dbo].[Organization]([Identifier] ASC)
WHERE [Identifier] IS NOT NULL;
END
GO