Prepare the base models and relationships.