Perform migration only if required.

@robyoung
@pbadenski