Restore and fix migrations