EnVisageOnline/Main-RMO/Database/Scripts/20150123/01_AspNetUsers_Add_PagePref...

11 lines
440 B
Transact-SQL

use EnVisage
if exists(select 1 from sys.columns where Name = N'PagePreferences' and Object_ID = Object_ID(N'AspNetUsers'))
set noexec on
begin transaction
ALTER TABLE [dbo].[AspNetUsers] ADD [PagePreferences] [nvarchar](max) NULL
go
UPDATE [dbo].[AspNetUsers] SET [PagePreferences]='' WHERE [PagePreferences] IS NULL
go
ALTER TABLE [dbo].[AspNetUsers] ALTER COLUMN [PagePreferences] [nvarchar](max) NOT NULL
commit transaction