"tag" should not be a primary key
Bug #550081 reported by
susahosh
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.
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: bazaar. launchpad. net/~jorge- silva/% 2Bjunk/ pylons- sample/ annotate/ head%3A/ tagin/model/ tables. py#L15
http://
should take care of the issue.