

IF EXISTS (SELECT 1 FROM SYS.DEFAULT_CONSTRAINTS WHERE NAME = 'DF_tbEntity_CanEditBuildTo')
BEGIN

	-- Update the existing default if the column has already been created.

	ALTER TABLE [dbo].[tbEntity]
		DROP CONSTRAINT [DF_tbEntity_CanEditBuildTo]
		
	ALTER TABLE [dbo].[tbEntity]
		ADD CONSTRAINT [DF_tbEntity_CanEditBuildTo] DEFAULT 1 FOR [CanEditBuildTo]

	-- Update the existing values in tbEntity from 'No Item' to 'Non Suggested'

	UPDATE [dbo].[tbEntity]
	SET CanEditBuildTo = 1
	WHERE CanEditBuildTo = 0

END
GO
