1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-25 21:34:52 -05:00

check if column exists

This commit is contained in:
✨ Audrey ✨ 2025-05-23 12:40:48 -04:00
parent 756b2b4e73
commit c533a3aa8c
No known key found for this signature in database

View File

@ -1,11 +1,11 @@
-- Add `Emails` field that stores a comma-separated list of email addresses for -- Add `Emails` field that stores a comma-separated list of email addresses for
-- email/OTP authentication to table and write methods. The read methods -- email/OTP authentication to table and write methods. The read methods
-- don't need to be updated because they all use `*`. -- don't need to be updated because they all use `*`.
IF NOT EXISTS(
IF (EXISTS (SELECT * SELECT *
FROM INFORMATION_SCHEMA.TABLES FROM [sys].[columns]
WHERE TABLE_SCHEMA = 'dbo' WHERE [object_id] = OBJECT_ID(N'[dbo].[Send]')
AND TABLE_NAME = 'Send')) AND [name] = 'Emails')
BEGIN BEGIN
ALTER TABLE [dbo].[Send] ADD [Emails] NVARCHAR(1024) NULL; ALTER TABLE [dbo].[Send] ADD [Emails] NVARCHAR(1024) NULL;
END END