if not exists (select * from sys.sysobjects where id = object_id(N'dbo.TodoUsers') and type = 'V')
    EXEC ('create view dbo.TodoUsers
as
select
    isnull(PrimaryTodoUsersID, ID) as TodoUsersID,
    ID as TodoUsersTodoID,
    ConnectionID as TodoUsersConnectionID,
    isnull(AssignedToUserID, ''00000000-0000-0000-0000-000000000000'') as TodoUsersUserInfoID,
    Comment as TodoUsersComment,
    isnull(Status, 1) as TodoUsersStatus,
    CreationDate as TodoUsersCreationDate,
    ModifiedDate as TodoUsersModifiedDate
from dbo.Todo');