https://bugs.kde.org/show_bug.cgi?id=393925

            Bug ID: 393925
           Summary: UpdateSchemaFromV7ToV9 fails due to duplicate key in
                    album_2
           Product: digikam
           Version: 5.9.0
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: Database-Migration
          Assignee: digikam-bugs-n...@kde.org
          Reporter: theo.van.r...@gmail.com
  Target Milestone: ---

After upgrading to Digikam 5.9.0, the database upgrade failed with this error:

digikam.dbengine: Loading SQL code from config file
"/usr/share/digikam/database/dbconfig.xml"
digikam.dbengine: Checking XML version ID => expected:  3  found:  3
digikam.coredb: Core database: running schema update
digikam.coredb: Core database: have a structure version  8
digikam.coredb: Core database: makeUpdates  8  to  9
digikam.dbengine: Failure executing query:
 "" 
Error messages: "QMYSQL: Unable to execute query" "Duplicate entry
'111-dsc00025.jpg' for key 'album_2'" 1062 2 
Bound values:  ()
digikam.dbengine: Error while executing DBAction [ "UpdateSchemaFromV7ToV9" ]
Statement [ "ALTER TABLE Images MODIFY COLUMN name LONGTEXT CHARACTER SET utf8
COLLATE utf8_general_ci NOT NULL;" ]
digikam.coredb: Core database: schema update to V 9 failed!
digikam.coredb: Core database: cannot process schema initialization

A query on the Images table showed there was one row with album = '111' and
name = 'dsc00025.jpg'. I found 2 indexes on the table Images ('album_2' and
'album_3') that are not defined in dbconfig.xml. After dropping both indexes
the migration was smooth & Digikam started normal.

My Digikam database is ancient and must have been updated numerous times. I
expect these superfluous indexes were created by earlier updates. I found more 
duplicate indexes on tables like AlbumRoots, Album & Tags. A function to drop
such superfluous indexes on migration might help to prevent data migration
issues.

I raised this bug to make you aware. For me the issue is solved already.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to