IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'pal_SurfaceField' AND COLUMN_NAME = 'actionType')
BEGIN
	ALTER TABLE [dbo].[pal_SurfaceField]
		ADD [actionType]   INT NULL
END

IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'pal_SurfaceField' AND COLUMN_NAME = 'action')
BEGIN
	ALTER TABLE [dbo].[pal_SurfaceField]
		ADD [action]       INT NULL
END

IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'pal_SurfaceField' AND COLUMN_NAME = 'actionSource')
BEGIN
	ALTER TABLE [dbo].[pal_SurfaceField]
		ADD [actionSource] INT NULL
END

IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'pal_SurfaceField' AND COLUMN_NAME = 'isHiddenFromView')
BEGIN
ALTER TABLE [dbo].[pal_SurfaceField]
    ADD [isHiddenFromView] BIT CONSTRAINT [DF_pal_SurfaceField_isHiddenFromView] DEFAULT ((0)) NULL;
END

