generate rails migration migration add_editor_version_to_grid_posts editor_version is utf8mb4_unicode_ci compatible string
def migration_generator(table_name, column_name, column_type, column_options) migration_name = "add_#{column_name}_to_#{table_name}" ActiveRecord::Migration.generate_migration(migration_name, column_name, table_name, column_type, column_options) end table_name = 'grid_posts' column_name = 'editor_version' column_type = 'string' column_options = 'utf8mb4_unicode_ci' migration_generator(table_name, column_name, column_type, column_options)