fix and reorganize migrations