Apply migration when needed