15 lines
632 B
Transact-SQL
15 lines
632 B
Transact-SQL
use Envisage
|
|
go
|
|
if exists(select * from sys.columns
|
|
where Name = N'PreferredResourceAllocation' and Object_ID = Object_ID(N'AspNetUsers'))
|
|
set noexec on
|
|
begin transaction
|
|
ALTER TABLE [dbo].[AspNetUsers] ADD [PreferredResourceAllocation] [bit] NULL
|
|
go
|
|
UPDATE [dbo].[AspNetUsers] SET [PreferredResourceAllocation]=0 WHERE [PreferredResourceAllocation] IS NULL
|
|
go
|
|
ALTER TABLE [dbo].[AspNetUsers] ADD CONSTRAINT [DF_AspNetUsers_PreferredResourceAllocation] DEFAULT ((0)) FOR [PreferredResourceAllocation]
|
|
go
|
|
ALTER TABLE [dbo].[AspNetUsers] ALTER COLUMN [PreferredResourceAllocation] [bit] NOT NULL
|
|
|
|
commit transaction |