Module: ROM::SQL::Migration
- Included in:
- Gateway
- Defined in:
- lib/rom/sql/migration.rb,
lib/rom/sql/migration/runner.rb,
lib/rom/sql/migration/writer.rb,
lib/rom/sql/migration/migrator.rb,
lib/rom/sql/migration/recorder.rb,
lib/rom/sql/migration/schema_diff.rb,
lib/rom/sql/migration/inline_runner.rb
Instance Attribute Summary collapse
-
#migrator ⇒ Object
readonly
Returns the value of attribute migrator.
Instance Method Summary collapse
- #auto_migrate!(conf, options = EMPTY_HASH) ⇒ Object
-
#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.
99 100 101 |
# File 'lib/rom/sql/migration.rb', line 99 def migrator @migrator end |
Instance Method Details
#auto_migrate!(conf, options = EMPTY_HASH) ⇒ Object
144 145 146 147 148 149 150 |
# File 'lib/rom/sql/migration.rb', line 144 def auto_migrate!(conf, = EMPTY_HASH) schemas = conf.relation_classes(self).map do |klass| klass.schema_proc.call.finalize_attributes!(gateway: self) end migrator.auto_migrate!(self, schemas, ) end |
#migration(&block) ⇒ Object
Migration DSL
124 125 126 |
# File 'lib/rom/sql/migration.rb', line 124 def migration(&block) migrator.migration(&block) end |