5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/interactors/active_record_migration_ui/migrate_migration_script.rb', line 5
def call
sanity_checks!
migration_paths = ActiveRecord::Migrator.migrations_paths
migration_context = ActiveRecord::MigrationContext.new(migration_paths)
ActiveRecordMigrationUi.running_migration = true
migration_context.migrate(context.version.to_i)
ActiveRecordMigrationUi.running_migration = false
context.final_state = 'up'
rescue StandardError => error
Rails.logger.warn "Migration of #{context.version} failed: " \
"#{error.message}"
context.final_state = 'failed'
end
|