Fix rails 4 compatibility issues in migrations