IF NOT EXISTS
(
  SELECT SysColumns.Name 
  FROM SysObjects WITH (NOLOCK) 
    INNER JOIN SysColumns WITH (NOLOCK) ON SysColumns.Id = SysObjects.ID 
    AND SysColumns.Name = 'RateLevelDefaultFKRestrictionId'
    WHERE SysObjects.Name = 'ProductExtended'
)
  ALTER TABLE ProductExtended ADD RateLevelDefaultFKRestrictionId INT NULL
GO

IF NOT EXISTS
(
  SELECT SysColumns.Name 
  FROM SysObjects WITH (NOLOCK) 
    INNER JOIN SysColumns WITH (NOLOCK) ON SysColumns.Id = SysObjects.ID 
    AND SysColumns.Name = 'RateLevelDefaultLength'
    WHERE SysObjects.Name = 'ProductExtended'
)
  ALTER TABLE ProductExtended ADD RateLevelDefaultLength INT NULL
GO

IF NOT EXISTS
(
  SELECT SysColumns.Name 
  FROM SysObjects WITH (NOLOCK) 
    INNER JOIN SysColumns WITH (NOLOCK) ON SysColumns.Id = SysObjects.ID 
    AND SysColumns.Name = 'RateLevelDefaultAllocation'
    WHERE SysObjects.Name = 'ProductExtended'
)
  ALTER TABLE ProductExtended ADD RateLevelDefaultAllocation INT NULL
GO

IF NOT EXISTS
(
  SELECT SysColumns.Name 
  FROM SysObjects WITH (NOLOCK) 
    INNER JOIN SysColumns WITH (NOLOCK) ON SysColumns.Id = SysObjects.ID 
    AND SysColumns.Name = 'RecalcPricesOnCurrRateChg'
    WHERE SysObjects.Name = 'ProductExtended'
)
  ALTER TABLE ProductExtended ADD RecalcPricesOnCurrRateChg BIT NOT NULL DEFAULT ((1))
GO

IF NOT EXISTS
(
  SELECT SysColumns.Name 
  FROM SysObjects WITH (NOLOCK) 
    INNER JOIN SysColumns WITH (NOLOCK) ON SysColumns.Id = SysObjects.ID 
    AND SysColumns.Name = 'UseDefaultBookTimeForRooms'
    WHERE SysObjects.Name = 'ProductExtended'
)
  ALTER TABLE ProductExtended ADD UseDefaultBookTimeForRooms BIT NULL DEFAULT ((0))
GO

IF NOT EXISTS
(
  SELECT SysColumns.Name 
  FROM SysObjects WITH (NOLOCK) 
    INNER JOIN SysColumns WITH (NOLOCK) ON SysColumns.Id = SysObjects.ID 
    AND SysColumns.Name = 'NoHostelDiscount'
    WHERE SysObjects.Name = 'ProductExtended'
)
  ALTER TABLE ProductExtended ADD NoHostelDiscount BIT NULL DEFAULT ((0))
GO
