I have been having issues with updating my yaf forum from. I have my database backup and I managed to setup yaf on my local machine. When trying to finish the installation I get an error. The versions I'm using:

Current Version: YAF.NET v1.9.301 (33)
Upgrade Version: YAF.NET v2.2.0 (57)

I go normally through wizard but after I click upgrade I get following error:


There are no primary or candidate keys in the referenced table 'dbo.yaf_MessageReported' that match the referencing column list in the foreign key 'FK_yaf_MessageReportedAudit_yaf_MessageReported'.
Could not create constraint or index. See previous errors.

if not exists (select top 1 1 from sys.objects where name='FK_yaf_MessageReportedAudit_yaf_MessageReported' and parent_object_id=object_id('[dbo].[yaf_MessageReportedAudit]') and type in (N'F'))
alter table [dbo].[yaf_MessageReportedAudit] add constraint [FK_yaf_MessageReportedAudit_yaf_MessageReported] foreign key(MessageID) references [dbo].[yaf_MessageReported] (MessageID)

I am not sure how to go about this and any advice would be greatly appreciated.

In case someone else has this error I have found the solution:
The issue is that yaf_MessageReported and yaf_MessageReportedAudit tables did not have a primary key defined. I have defined those keys in the DB and now the update works.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved