YAFLogo

belsebubii
  • belsebubii
  • 51.2% (Neutral)
  • YAF Forumling Topic Starter
7 years ago
Hello,

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:

FILE:

mssql/upgrade/constraints.sql

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.

STATEMENT:

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.

Thanks!

Sponsor
belsebubii
  • belsebubii
  • 51.2% (Neutral)
  • YAF Forumling Topic Starter
7 years ago
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.