Module: ROM::SQL::Migration
- Included in:
- Gateway
- Defined in:
- lib/rom/sql/migration.rb,
lib/rom/sql/migration/migrator.rb
Defined Under Namespace
Classes: Migrator
Instance Attribute Summary collapse
-
#migrator ⇒ Object
readonly
Returns the value of attribute migrator.
Instance Method Summary collapse
- #initialize(uri, options = EMPTY_HASH) ⇒ Object private
-
#migration(&block) ⇒ Object
Migration DSL.
-
#pending_migrations? ⇒ Boolean
Check if there are any pending migrations.
-
#run_migrations(options = {}) ⇒ Object
Run migrations.
Instance Attribute Details
#migrator ⇒ Object (readonly)
Returns the value of attribute migrator.
44 45 46 |
# File 'lib/rom/sql/migration.rb', line 44 def migrator @migrator end |
Instance Method Details
#initialize(uri, options = EMPTY_HASH) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 |
# File 'lib/rom/sql/migration.rb', line 47 def initialize(uri, = EMPTY_HASH) @migrator = .fetch(:migrator) { Migrator.new(connection) } end |
#migration(&block) ⇒ Object
Migration DSL
65 66 67 |
# File 'lib/rom/sql/migration.rb', line 65 def migration(&block) migrator.migration(&block) end |
#pending_migrations? ⇒ Boolean
Check if there are any pending migrations
56 57 58 |
# File 'lib/rom/sql/migration.rb', line 56 def pending_migrations? migrator.pending? end |
#run_migrations(options = {}) ⇒ Object
Run migrations
78 79 80 |
# File 'lib/rom/sql/migration.rb', line 78 def run_migrations( = {}) migrator.run() end |