
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[pal_SurfaceFieldValidationType]')
 AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
BEGIN
	CREATE TABLE [dbo].[pal_SurfaceFieldValidationType](
		[recId] [int] IDENTITY(1,1) NOT NULL,
		[validationType] [varchar](50) NULL,
		[isActive] [bit] NULL,
	 CONSTRAINT [PK_pal_SurfaceFieldValidationType] 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]
END

TRUNCATE TABLE pal_SurfaceFieldValidationType

INSERT INTO pal_SurfaceFieldValidationType
SELECT	'email',1

INSERT INTO pal_SurfaceFieldValidationType
SELECT	'id number',1


IF NOT EXISTS(
    SELECT *
    FROM sys.columns 
    WHERE Name      = N'isCapitalizeInput'
      AND Object_ID = Object_ID(N'pal_Surface'))
BEGIN
    ALTER TABLE pal_Surface
	ADD isCapitalizeInput BIT null; 
END


IF NOT EXISTS(
    SELECT *
    FROM sys.columns 
    WHERE Name      = N'validationType'
      AND Object_ID = Object_ID(N'pal_SurfaceField'))
BEGIN
    ALTER TABLE pal_SurfaceField
	ADD validationType INT null; 
END
