IF (NOT EXISTS 
	(SELECT * FROM INFORMATION_SCHEMA.TABLES 
    WHERE TABLE_NAME = 'pal_SurfaceSignature'))
BEGIN


	CREATE TABLE [dbo].[pal_SurfaceSignature](
		[recId] [int] IDENTITY(1,1) NOT NULL,
		[itemId] [int] NULL,
		[fieldId] [int] NULL,
		[authoritive] [varchar](250) NULL,
		[signatureFile] [varchar](max) NULL,
		[signatureDate] [datetime] NULL,
		[photoFile] [varchar](max) NULL,
		[photoDate] [datetime] NULL,
		[isActive] [bit] NULL,
	 CONSTRAINT [PK_pal_SurfaceSignature] 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


IF (NOT EXISTS 
	(SELECT * FROM INFORMATION_SCHEMA.TABLES 
    WHERE TABLE_NAME = 'pal_SurfaceSignatureConfig'))
BEGIN

	CREATE TABLE [dbo].[pal_SurfaceSignatureConfig](
		[recId] [int] IDENTITY(1,1) NOT NULL,
		[fieldId] [int] NULL,
		[labelText] [varchar](500) NULL,
		[disclaimer] [varchar](max) NULL,
		[includePhoto] [bit] NULL,
		[allowPhotoEdit] [bit] NULL,
		[allowSignatureEdit] [bit] NULL,
		[editRoles] [varchar](200) NULL,
	 CONSTRAINT [PK_pal_SurfaceSignatureConfig] 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
