fix of foreign keys in db, db revision 2