"tag" should not be a primary key

Bug #550081 reported by susahosh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tagin!
Won't Fix
High
Jorge Silva

Bug Description

The Tags table in DB currently has only one column where tag is a primary key, this is a very bad design because tags are strings and could have large lengths. When it is used as a primary key and it is used as a foreign key by other tables all of the tables would have to contain the exact same string and it is very redundant and inefficient.

One correct way to do this would be to have a tagid, and a tag column in the Tags table, where the unique database constrain is enforced on the tag column. This way duplicating of any tag would be prevented while other tables can easily use the tagid as a foreign key value to refer to a tag in the Tags table.

Tags: 503037
description: updated
Revision history for this message
Jorge Silva (jorge-silva) wrote :

I am working on a port of the DB model on SQLAlquemy as part of my evaluation of Pylons as a potential framework. The new model here:
http://bazaar.launchpad.net/~jorge-silva/%2Bjunk/pylons-sample/annotate/head%3A/tagin/model/tables.py#L15

should take care of the issue.

Changed in tagin:
assignee: nobody → Jorge Silva (jorge-silva)
importance: Undecided → High
status: New → In Progress
tags: added: 503037
Revision history for this message
Jorge Silva (jorge-silva) wrote :

tagin will be re-written, this bug is now obsolete

Changed in tagin:
status: In Progress → Won't Fix
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.