
USE [Licenses_mdb]
GO
IF NOT EXISTS(SELECT nID FROM [tblFeatures] WHERE nID=133)
	INSERT [dbo].[tblFeatures] ([nID], [tName], [fVisible], [tFunctionName], [tFormName], [nMode]) VALUES (133, N'Access all Organizations', 1, N'', N'', 0);

GO
IF NOT EXISTS(SELECT nID FROM [tblFeatures] WHERE nID=134)
BEGIN
	INSERT [dbo].[tblFeatures] ([nID], [tName], [fVisible], [tFunctionName], [tFormName], [nMode]) VALUES (134, N'Import G-Suite Devices', 1, N' ', N' ', 0)
END
GO
/*** Add the new features to admins, IT Managers, Asset Manager, Software Managers and all users by default	***/
IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=133 AND [tGroup]='Admins' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'Admins', 133, 1);

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=133 AND [tGroup]='IT Managers' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'IT Managers', 133, 1);

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=133 AND [tGroup]='SoftwareManagers' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'SoftwareManagers', 133, 1);

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=133 AND [tGroup]='HelpDesk-Analysts' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'HelpDesk-Analysts', 133, 1);

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=133 AND [tGroup]='Users' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'Users', 133, 1);

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=133 AND [tGroup]='Employees' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'Employees', 133, 1);

GO

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=132 AND [tGroup]='Admins' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'Admins', 132, 1);

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=132 AND [tGroup]='IT Managers' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'IT Managers', 132, 1);

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=132 AND [tGroup]='SoftwareManagers' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'SoftwareManagers', 132, 1);

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=132 AND [tGroup]='HelpDesk-Analysts' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'HelpDesk-Analysts', 132, 1);

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=132 AND [tGroup]='Users' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'Users', 132, 1);

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=132 AND [tGroup]='Employees' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'Employees', 132, 1);

GO

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=131 AND [tGroup]='Admins' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'Admins', 131, 1);

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=131 AND [tGroup]='IT Managers' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'IT Managers', 131, 1);

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=131 AND [tGroup]='SoftwareManagers' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'SoftwareManagers', 131, 1);

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=131 AND [tGroup]='HelpDesk-Analysts' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'HelpDesk-Analysts', 131, 1);

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=131 AND [tGroup]='Users' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'Users', 131, 1);

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=131 AND [tGroup]='Employees' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'Employees', 131, 1);

GO

IF NOT EXISTS(SELECT nID FROM [tblFeatures] WHERE nID=135)
	INSERT [dbo].[tblFeatures] ([nID], [tName], [fVisible], [tFunctionName], [tFormName], [nMode]) VALUES (135, N'View Vector Discovery Installer Download', 1, N'', N'', 0);


GO

IF NOT EXISTS(SELECT nID FROM [tblFeatures] WHERE nID=137)
	INSERT [dbo].[tblFeatures] ([nID], [tName], [fVisible], [tFunctionName], [tFormName], [nMode]) VALUES (137, N'Auto-Refresh Dashboard', 1, N'', N'', 0);

GO

IF NOT EXISTS(SELECT nID FROM [tblFeatures] WHERE nID=138)
INSERT [dbo].[tblFeatures] ([nID], [tName], [fVisible], [tFunctionName], [tFormName], [nMode]) VALUES (138, N'Show Return to Storage Location', 1, N' ', N' ', 0);

GO

