Database update, fixed foreign keys in models