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
|