if not exists (select * from VCLib.T_ENTITIES where BaseEntity = (select EntityId from VCLib.T_ENTITIES where EntName = 'NEWS_BOX' and [Schema] = 'VCLib'))
BEGIN

	IF EXISTS (
        SELECT 1
        FROM sys.foreign_keys
        WHERE name = 'FK_T_ENTITIES_T_NEWS_BOX_type_'
          AND parent_object_id = OBJECT_ID('CLib.T_NEWS_BOX')
    )
    BEGIN
        ALTER TABLE VCLib.T_NEWS_BOX drop constraint FK_T_ENTITIES_T_NEWS_BOX_type_
    END

    IF COL_LENGTH('VCLib.T_NEWS_BOX', 'type_') IS NOT NULL
    BEGIN
	ALTER TABLE VCLib.T_NEWS_BOX drop column type_
    END
END