1

Closed

Failure UPgrading to 2.2.2 if using DNN Object Qualifiers

description

FILE:
mssql/upgrade/tables.sql

ERROR:
Invalid object name 'dbo.yaf_Attachment'.

STATEMENT:
if not exists(select top 1 1 from sys.columns where object_id = object_id(N'[dbo].[dnn_yaf_Attachment]') and name=N'UserID')
begin
   alter table [dbo].[dnn_yaf_Attachment] add UserID int not null default (0)

exec('
declare @MessageID int
declare @UserID int

declare curMessages cursor for
        select 
            a.MessageID,
m.UserID
        from
            [dbo].[dnn_yaf_Attachment] a  
INNER JOIN [dbo].[dnn_yaf_Message] m ON m.MessageID = a.MessageID

        where
            a.UserID = 0

    open curMessages

    -- cycle through messages
    fetch next from curMessages into @MessageID, @UserID
    while @@FETCH_STATUS = 0
    begin
        update [dbo].[yaf_Attachment] SET UserID = @UserID where MessageID = @MessageID and UserID = 0

        fetch next from curMessages into @MessageID, @UserID
    end
    close curMessages
    deallocate curMessages')
end 
Closed Jul 7, 2015 at 10:45 AM by tha_watcha

comments

tha_watcha wrote Jul 7, 2015 at 10:45 AM

Fixed in latest commit (YAF 2.2.3)

P.S: Please use the GitHub Issue Tracker next time

https://github.com/YAFNET/YAFNET-DNN/issues