/****** Object:  Table [dbo].[ProductGroup]    Script Date: 24-02-2021 16:08:06 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ProductGroup]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ProductGroup](
	[ProductGroupID] [int] IDENTITY(1,1) NOT NULL,
	[ProductGroupName] [varchar](255) NULL,
	[ResourceType] [int] NULL,
	[ViewType] [int] NULL,
 CONSTRAINT [PK_ProductGroup] PRIMARY KEY CLUSTERED 
(
	[ProductGroupID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IF NOT EXISTS
(
  SELECT SysColumns.Name 
  FROM SysObjects WITH (NOLOCK) 
    INNER JOIN SysColumns WITH (NOLOCK) ON SysColumns.Id = SysObjects.ID 
    AND SysColumns.Name = 'ViewType'
    WHERE SysObjects.Name = 'ProductGroup'
)
BEGIN
	ALTER TABLE [dbo].[ProductGroup] 
		ADD ViewType int NULL 
END


