[Digikam-devel] Update query fails

Swati Lodha swatilodha27 at gmail.com
Tue May 31 12:26:31 BST 2016


Hello.

I was facing this error from past few days:

MariaDB [digikam]> update Albums set albumRoot=0 where id=10;
> ERROR 1452 (23000): Cannot add or update a child row: a foreign key
> constraint fails (`digikam`.`Albums`, CONSTRAINT `Albums_AlbumRoot
> s` FOREIGN KEY (`albumRoot`) REFERENCES `AlbumRoots` (`id`) ON DELETE
> CASCADE ON UPDATE CASCADE)
>
>
I figured out that as 'id' is AlbumRoots table is not 0. So 'albumRoot' in
Images table can't be set to 0. This is I think the possible reason for FK
constraint failing.

I used this statement instead & it worked:

MariaDB [digikam]> update Albums set albumRoot=1 where id=10;
> Query OK, 0 rows affected (0.06 sec)
> Rows matched: 1  Changed: 0  Warnings: 0


Please look into this.

Regards
ᐧ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/digikam-devel/attachments/20160531/ef219d15/attachment.html>


More information about the Digikam-devel mailing list