Fixed migration order and dependencies.