Hi All,
I hope someone might have seen this issue or something similar before. I am currently trying to update a site from DNN version 4.9.5 eventually to 6.1.5, but while trying to update the database to version 5.0.0 I get a number of errors similar to this one -
System.Data.SqlClient.SqlException: There are no primary or candidate keys in the referenced table 'dbo.CTN_PortalDesktopModules' that match the referencing column list in the foreign key 'FK_CTN_DesktopModulePermission_CTN_PortalDesktopModules'.
Could not create constraint. See previous errors.
at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL)
at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions)
On further investigation it appears that a large number of the tables in the database do not have a Primary Key defined in the table. While this is almost certainly the cause of the problem, I am just wondering if has anyone seen this kind of error before while upgrade from 4.9.5? If anyone has, how did you go about solving it?
Thanks,
Chris