1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-26 12:55:17 +01:00
bitwarden-server/util/Migrator/DbScripts/2020-06-23_00_OrgIdentifier.sql

20 lines
484 B
MySQL
Raw Normal View History

2020-06-24 05:54:27 +02:00
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
2020-06-24 18:24:36 +02:00
CREATE UNIQUE NONCLUSTERED INDEX [IX_Organization_Identifier]
2020-06-24 05:54:27 +02:00
ON [dbo].[Organization]([Identifier] ASC)
2020-06-24 18:24:36 +02:00
WHERE [Identifier] IS NOT NULL;
2020-06-24 05:54:27 +02:00
END
GO