
IF((SELECT COUNT(*) FROM dbo.pal_Surface WHERE name = 'GroupPostboxSchools') = 1)
BEGIN

UPDATE pal_Surface SET isPublished = 1 WHERE name = 'GroupPostboxSchools';
END;

IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'publ_GroupPostboxSchools')
BEGIN

/****** Object:  Table [dbo].[publ_GroupPostboxSchools]    Script Date: 2020/06/01 13:54:11 ******/
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[publ_GroupPostboxSchools](
	[itemID] [int] NOT NULL,
	[isActive] [bit] NULL,
	[surfaceId] [int] NOT NULL,
	[ParentSurfaceItemId] [int] NULL,
	[GroupPostboxSchools_GroupPostboxSchools_GroupName] [varchar](max) NULL,
	[GroupPostboxSchools_GroupPostboxSchools_SchoolPostboxName] [varchar](max) NULL,
	[GroupPostboxSchools_GroupPostboxSchools_SchoolName] [varchar](max) NULL,
	[GroupPostboxSchools_GroupPostboxSchools_Type] [int] NULL,
	[GroupPostboxSchools_GroupPostboxSchools_CentreNumber] [varchar](max) NULL,
	[GroupPostboxSchools_GroupPostboxSchools_AssessmentMaterialsCanvasName] [varchar](max) NULL,
	[GroupPostboxSchools_GroupPostboxSchools_AssessmentRecordsCanvasName] [varchar](max) NULL,
	[GroupPostboxSchools_GroupPostboxSchools_CorrespondenceCanvasName] [varchar](max) NULL,
	[recId] [int] IDENTITY(1,1) NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[recId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

END;
