[Digikam-devel] [digikam] [Bug 355831] MySQL Schema Improvements
Richard Mortimer via KDE Bugzilla
bugzilla_noreply at kde.org
Thu Apr 21 20:24:47 BST 2016
https://bugs.kde.org/show_bug.cgi?id=355831
--- Comment #66 from Richard Mortimer <richm+kde at oldelvet.org.uk> ---
(In reply to swatilodha27 from comment #63)
> Hello Richard.
>
> I'm Swati, currently working on digiKam MySQL database support project. I
> read this open bug for MySQL Schema improvements and thought of a plausible
> solution to handle the tags (rename, move or delete)
>
> An image can have many tags and a tag can belong to multiple image. So to
> handle this many-many relationship between the two, we could take use of the
> following tables:
>
> Table: Image
> Columns: Image_ID, Image_Title
>
> Table: Tag
> Columns: Tag_ID, Tag_Title
>
> Table: Image_Tag
> Columns: Tag_ID, Image_ID
>
> Setting the Image_ID and Tag_ID as foreign keys would help in linking the
> tables.
>
Foreign keys have already been added here.
CONSTRAINT ImageTags_Images FOREIGN KEY (imageid) REFERENCES Images (id) ON
DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT ImageTags_Tags FOREIGN KEY (tagid)
REFERENCES Tags (id) ON DELETE CASCADE ON UPDATE CASCADE,
Without seeing a specific error I cannot tell what the problem may be with
rename, move or delete.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Digikam-devel
mailing list