I upgraded from 4.4.1 to 4.5.0
During upgrade batch, the sql scripts log wrote an error and wrote it in 04.05.00.log:
System.Data.SqlClient.SqlException: CREATE UNIQUE INDEX terminated because a duplicate key was found for index ID 7.
Most significant primary key is '<NULL>'.
Could not create constraint. See previous errors.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(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)
/* Add Constraint to FolderPath */
/********************************/
IF NOT EXISTS (select * from dbo.sysobjects where id = object_id(N'dbo.[IX_FolderPath]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
BEGIN
ALTER TABLE dbo.Folders ADD CONSTRAINT
IX_FolderPath UNIQUE NONCLUSTERED
(
PortalID,
FolderPath
) ON [PRIMARY]
END
I query the Folders table and I see a lot of duplications in PortalID, FolderPath colums, like this (just an example):
FolderID |
PortalID |
FolderPath |
StorageLocation |
IsProtected |
IsCached |
LastUpdated |
107 |
0 |
MyFolder/ |
0 |
0 |
0 |
|
274 |
0 |
MyFolder/ |
0 |
0 |
0 |
|
275 |
0 |
MyFolder/MySubfolder/ |
0 |
0 |
0 |
|
120 |
0 |
MyFolder/MySubfolder/ |
0 |
0 |
0 |
|
I do not modified core db or dnn source code.
Sometimes I use to upload files in Portals/0 folder via ftp. Is this the cause for this error?
PS: I noticed that in Folders table that some path contains double "/" example: MyFolder/MySubfolder//
Is it normal?
Thanks
Luca