<div dir="ltr">Okay, I found the issue: imageid = 0, there is no image existing in the table "Images" but there is an entry with that ID in the table "ImageInformation".<div><br></div><div>Would be good to have this exception catched and handled, in case that happens for others.</div><div><br></div><div>BR<br>Christoph</div></div><br><div class="gmail_quote"><div dir="ltr">Christoph Huckle <<a href="mailto:chrihuc@gmail.com">chrihuc@gmail.com</a>> schrieb am Fr., 19. Aug. 2016 um 14:06 Uhr:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span style="font-family:monospace">Hello Gents,</span></div><div><br></div><span style="font-family:monospace"><div>I've looked in the bug reports and also in the mail-list but couldn't solve this issue:</div><div><br></div><div>I try to migrate my existing sqlite database into mysql and as soon as it starts copying over the imageinformation this error happens:</div><div><span style="font-family:monospace"><br></span></div>digikam.dbengine: Failure executing query:
<br> "INSERT INTO ImageInformation (imageid, rating, creationDate, digitizationDate, orientation, width, height, format, colorDepth, colorModel) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"  <br>Error messages: "QMYSQL3: Der Befehl konnte nicht ausgeführt werden" "Cannot add or update a child row: a foreign key constraint fails (`digikam`.`ImageInformation`, CONSTRAINT `ImageInformation_Images` FOREIGN KEY (`imageid`) REFERENCES `Images` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)" 1452 2  <br>Bound values:  (QVariant(qlonglong, 0), QVariant(qlonglong, 0), QVariant(QString, "2013-07-21T11:49:57"), QVariant(QString, "2013-07-21T11:49:57"), QVariant(qlonglong, 1), QVariant(qlonglong, 3024), QVariant(qlonglong, 2016), QVariant(QString, "JPG"), QVariant(qlonglong, 8), QVariant(qlonglong, 5))
<br>digikam.dbengine: Error while executing DBAction [ "Migrate_Write_ImageInformation" ] Statement [ "INSERT INTO ImageInformation (imageid, rating, creationDate, digitizationDate, orientation, width, height, format, colorDepth, colorModel) VALUES (:imageid, :rating, :creationDate, :digitizationDate, :orientation, :width, :height, :format, :colorDepth, :colorModel);" ]
<br>digikam.coredb: Core database: error while converting table data. Details:  QSqlError("1452", "QMYSQL3: Der Befehl konnte nicht ausgeführt werden", "Cannot add or update a child row: a foreign key constraint fails(`digikam`.`ImageInformation`, CONSTRAINT `ImageInformation_Images` FOREIGN KEY (`imageid`) REFERENCES `Images` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)")<br>
<br></span><div>Tried it a few times, always the same error.</div><div><br></div><div>Let me know if you need more information or if I shall open a bug report.</div><div><br></div><div>Cheers</div></div><div dir="ltr"><div>Christoph</div></div></blockquote></div>