prepare db for many-to-many keys