Combine all the *_tag tables into one table

Bug #1774103 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Wishlist
Unassigned

Bug Description

Currently we have

- artefact_tag
- collection_tag
- view_tag
- usr_tag

tables and if we want to have new tagging, say for groups we would need to add another table

It might be easier to combine all these tables so that we can do easier queries, like what are all the tags for an owner. Rather than having to do a bunch of table joins and checking what things are owned by what view/artefact etc we can just query the one table.

I'm thinking of having one table with the fields

 id, tag, resourcetype, resourceid, ownertype, ownerid, editedby, ctime, mtime

where resourcetype is either 'view', 'artefact' etc
and resourceid is the id of that type

Where ownertype can be 'user', 'group', institution'
and ownerid can be the id number or shortname

And editedby can be the ID of the current user interacting with the tag - useful for group/institution tags

ctime = created time
mtime = modified time

This is to support a number of new tag features for Mahara 18.10.

Sponsored by PHBern.

Changed in mahara:
status: New → Confirmed
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/8908
Committed: https://git.mahara.org/mahara/mahara/commit/b156f2e20b2fcf312e975886fcd34d615d5c78ab
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit b156f2e20b2fcf312e975886fcd34d615d5c78ab
Author: Robert Lyon <email address hidden>
Date: Tue May 29 16:16:43 2018 +1200

Bug 1774103: Looking to combine all the *_tag tables

So that we only have one 'tag' table that holds all the tag information

behatnotneeded

Change-Id: Ieb83e61da45edddfa8703816c11f3658c5394c47
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/8907
Committed: https://git.mahara.org/mahara/mahara/commit/ffa516591dfd22d8b7265d1f239cfa05023011e6
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit ffa516591dfd22d8b7265d1f239cfa05023011e6
Author: Robert Lyon <email address hidden>
Date: Tue May 29 15:21:59 2018 +1200

Bug 1774103: New structure for the tags table

Looking at consolidating all the differnet *_tag tables into one table

Also fixing up older upgrade where we add a column and then delete it
again. It slows down the upgrade for no gain.

behatnotneeded

Change-Id: I715a076dab74bca2897c56b171cc0536d6c65ff4
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: Confirmed → Fix Committed
tags: added: nominatedfeature
description: updated
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.