We have a simple interface to tag a particular question
(e.g. entry has 1..many tags and each tag entry has a foriegn key pointer back to the entry table)
1. What is the current production version of the jdk? (Tags: jdk6 jdk-6 jdk java)
2. In what version was java.util.spi package introduced? (Tags: jdk-6, jdk7, jdk5)
3. Which version of java is going to be released soon? (Tags: jdk-6, jdk7, jdk8)
We would like to merge all tags named as "jdk-6" to jdk6. How do we achieve this in a system which is nearing production but contains useful data.
In [1] jdk-6 needs to be removed, since jdk6 is already present. In [2,3] jdk-6 needs to be renamed as "jdk6".
What kind of scripts do I need to migrate this data in a effective fashion.
EDIT
create table entry (id, question, ...)
create table entry_tag (id, entry_id, tag)