Add foreign key stuff and rename a class