Fixed migrations code