diff options
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 6 |
2 files changed, 3 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index c9dd915e98..cbb93e0ffe 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -996,7 +996,7 @@ module ActiveRecord end def insert_versions_sql(versions) # :nodoc: - sm_table = quote_table_name(ActiveRecord::Migrator.schema_migrations_table_name) + sm_table = quote_table_name(ActiveRecord::SchemaMigration.table_name) if versions.is_a?(Array) sql = "INSERT INTO #{sm_table} (version) VALUES\n" @@ -1025,7 +1025,7 @@ module ActiveRecord def assume_migrated_upto_version(version, migrations_paths) migrations_paths = Array(migrations_paths) version = version.to_i - sm_table = quote_table_name(ActiveRecord::Migrator.schema_migrations_table_name) + sm_table = quote_table_name(ActiveRecord::SchemaMigration.table_name) migrated = select_values("SELECT version FROM #{sm_table}").map(&:to_i) versions = ActiveRecord::Migrator.migration_files(migrations_paths).map do |file| diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index c47e32df59..d8cf784933 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -1022,12 +1022,8 @@ module ActiveRecord new(:up, migrations(migrations_paths), nil) end - def schema_migrations_table_name - SchemaMigration.table_name - end - def get_all_versions(connection = Base.connection) - if connection.table_exists?(schema_migrations_table_name) + if SchemaMigration.table_exists? SchemaMigration.all.map { |x| x.version.to_i }.sort else [] |