Module: ActiveRecord::Turntable::Migration::Migrator::ClassMethods
- Defined in:
- lib/active_record/turntable/migration.rb
Instance Method Summary collapse
- #down(migrations_paths, target_version = nil, &block) ⇒ Object
- #run(*args) ⇒ Object
- #up(migrations_paths, target_version = nil) ⇒ Object
Instance Method Details
#down(migrations_paths, target_version = nil, &block) ⇒ Object
153 154 155 156 157 158 159 160 161 |
# File 'lib/active_record/turntable/migration.rb', line 153 def down(migrations_paths, target_version = nil, &block) result = super ActiveRecord::Tasks::DatabaseTasks.each_current_turntable_cluster_connected(current_environment) do |name, configuration| puts "[turntable] *** Migrating database: #{configuration['database']}(Shard: #{name})" super(migrations_paths, target_version, &block) end result end |
#run(*args) ⇒ Object
163 164 165 166 167 168 169 170 171 |
# File 'lib/active_record/turntable/migration.rb', line 163 def run(*args) result = super ActiveRecord::Tasks::DatabaseTasks.each_current_turntable_cluster_connected(current_environment) do |name, configuration| puts "[turntable] *** Migrating database: #{configuration['database']}(Shard: #{name})" super(*args) end result end |
#up(migrations_paths, target_version = nil) ⇒ Object
143 144 145 146 147 148 149 150 151 |
# File 'lib/active_record/turntable/migration.rb', line 143 def up(migrations_paths, target_version = nil) result = super ActiveRecord::Tasks::DatabaseTasks.each_current_turntable_cluster_connected(current_environment) do |name, configuration| puts "[turntable] *** Migrating database: #{configuration['database']}(Shard: #{name})" super(migrations_paths, target_version) end result end |