Bug 388121 - SQL schema update from version 8 to version 9 fails
Summary: SQL schema update from version 8 to version 9 fails
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Schema (show other bugs)
Version: 5.8.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-21 17:30 UTC by Jyrki Soini
Modified: 2017-12-21 21:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.8.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jyrki Soini 2017-12-21 17:30:20 UTC
Starting 
~> ./digikam-5.8.0-20171217T160920-x86-64.appimage 
tries to update mariadb database schema from version 8 to version 9.
I am running this on OpenSUSE Thumbleweed. Error message below.


-- digiKam AppImage Bundle
-- Use 'help' as CLI argument to know all available options
digikam.widgets: Breeze icons ressource file found
digikam.general: AlbumWatch use QFileSystemWatcher
digikam.general: Database Parameters:
   Type:                     "QMYSQL"
   DB Core Name:             "digikam"
   DB Thumbs Name:           "digikam"
   DB Face Name:             "digikam"
   Connect Options:          "UNIX_SOCKET=/run/mysql/mysql.sock"
   Host Name:                "localhost"
   Host port:                3306
   Internal Server:          false
   Internal Server Path:     ""
   Internal Server Serv Cmd: ""
   Internal Server Init Cmd: ""
   Username:                 "digikam"
   Password:                 "XXXXXXXXXXXXXXXXXXXX"

digikam.dbengine: Loading SQL code from config file "/tmp/.mount_69FrTt/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" "Cannot delete rows from table which is parent in a foreign key constraint 'Images_Albums' of table 'Images'" 1834 2 
Bound values:  ()
digikam.dbengine: Error while executing DBAction [ "UpdateSchemaFromV8ToV9" ] Statement [ "ALTER TABLE Albums CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;" ]
digikam.coredb: Core database: schema update to V 9 failed!
digikam.coredb: Core database: cannot process schema initialization
KMemoryInfo: Platform identified :  "LINUX"
KMemoryInfo: TotalRam:  16765005824
digikam.general: Allowing a cache size of 200 MB
QThreadStorage: Thread 0x7f20ce1efb80 exited after QThreadStorage 11 destroyed
Comment 1 Maik Qualmann 2017-12-21 21:15:53 UTC
Git commit 2809d4c44f82e6bebbf1ed6eba3d23df571549d1 by Maik Qualmann.
Committed on 21/12/2017 at 21:14.
Pushed by mqualmann into branch 'master'.

disable for update v8 to v9 temporarily the foreign key check
FIXED-IN: 5.8.0

M  +2    -1    NEWS
M  +2    -0    data/database/dbconfig.xml.cmake.in

https://commits.kde.org/digikam/2809d4c44f82e6bebbf1ed6eba3d23df571549d1
Comment 2 Maik Qualmann 2017-12-21 21:19:13 UTC
Notes: Your database is probably not consistent. After the update, it is best to use the migration tool to copy your old database into a newly created database.

Maik