BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE [dbo].[UserDevice] ADD
	[UserDeviceType] [int] NOT NULL DEFAULT 0
GO

UPDATE [dbo].[UserDevice] SET "UserDeviceType"=1 WHERE "Token" is not null;
GO
UPDATE [dbo].[UserDevice] SET "UserDeviceType"=2 WHERE "Token" is null;
GO
COMMIT