Put schema in an order which can actually be run.