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

IF NOT EXISTS(
    SELECT *
    FROM sys.columns 
    WHERE Name      = N'lockedDateTime'
      AND Object_ID = Object_ID(N'pal_Account'))
BEGIN
    ALTER TABLE pal_Account
	ADD lockedDateTime DATETIME NULL; 
END

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

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

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

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

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

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

IF NOT EXISTS(
    SELECT *
    FROM sys.columns 
    WHERE Name      = N'lockedDateTime'
      AND Object_ID = Object_ID(N'pal_Account'))
BEGIN
    ALTER TABLE pal_Account
	ADD lockedDateTime DATETIME NULL; 
END