Adds foreign key constraints to tag database