Skip to content

Instantly share code, notes, and snippets.

@floehopper
Created September 6, 2022 19:55
Show Gist options
  • Save floehopper/b64e879a29460c911e67c72f023ccb98 to your computer and use it in GitHub Desktop.
Save floehopper/b64e879a29460c911e67c72f023ccb98 to your computer and use it in GitHub Desktop.
Run migration from Rails console
migration_context = ActiveRecord::Base.connection.migration_context
migration_context.migrate(target_version = nil)
migration_context.rollback(steps = 1)
migration_context.forward(steps = 1)
migration_context.up(target_version = nil)
migration_context.down(target_version = nil)
migration_context.current_version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment