sort entities to create tables before sql views
code formatting