if not exists (select * FROM sys.syscolumns where name = 'ConnectionCacheID' AND id = object_id(N'dbo.DatabaseInfo')) BEGIN
  alter table dbo.DatabaseInfo ADD ConnectionCacheID varchar(100) NULL
END;

if not exists (select * FROM sys.syscolumns where name = 'UserType' AND id = object_id(N'dbo.UserInfo')) BEGIN
  alter table dbo.UserInfo ADD UserType int NOT NULL Default(0)
END;

if not exists (select * FROM sys.syscolumns where name = 'CanAdd' AND id = object_id(N'dbo.UserGroupInfo')) BEGIN
  alter table dbo.UserGroupInfo ADD CanAdd bit NOT NULL Default(1)
END;

if not exists (select * FROM sys.syscolumns where name = 'CanEdit' AND id = object_id(N'dbo.UserGroupInfo')) BEGIN
  alter table dbo.UserGroupInfo ADD CanEdit bit NOT NULL Default(1)
END;

if not exists (select * FROM sys.syscolumns where name = 'CanDelete' AND id = object_id(N'dbo.UserGroupInfo')) BEGIN
  alter table dbo.UserGroupInfo ADD CanDelete bit NOT NULL Default(1)
END;