generate rails 6 migration migration add_editor_version_to_grid_posts editor_version is utf8mb4_unicode_ci compatible string
def generate_migration(table_name, field_name, data_type, length) return "rails generate migration add_#{field_name}_to_#{table_name} #{field_name}:#{data_type}(#{length})" end generate_migration('grid_posts', 'editor_version', 'string', '255')