Perform migrations only if required.

@pbadenski
@robyoung