Add associations to database.