1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
module DataMigrate
class MigrationFive < ::ActiveRecord::Migration[5.0]
class << self
def check_pending!(connection = ::ActiveRecord::Base.connection)
raise ActiveRecord::PendingMigrationError if DataMigrator::Migrator.needs_migration?(connection)
end
def migrate(direction)
new.migrate direction
end
def table_name
ActiveRecord::Base.table_name_prefix + 'data_migrations' + ActiveRecord::Base.table_name_suffix
end
def primary_key
"version"
end
end
def initialize(name = self.class.name, version = nil)
super(name, version)
end
end
end
|