diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-01-18 12:11:45 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-01-18 12:22:27 +0900 |
commit | 5c624d0c1cc46354ebea3b78f023b82002ba848e (patch) | |
tree | 09b4c4852ad827636dbe046958a57737f81d77f7 /activerecord/lib | |
parent | af5dd491b5e204570aac84eb828ea7d5b1e6f7e9 (diff) | |
download | rails-5c624d0c1cc46354ebea3b78f023b82002ba848e.tar.gz rails-5c624d0c1cc46354ebea3b78f023b82002ba848e.tar.bz2 rails-5c624d0c1cc46354ebea3b78f023b82002ba848e.zip |
Remove `initialize_schema_migrations_table` and `initialize_internal_metadata_table` internal public methods
These internal methods accidentally appeared in the doc, and so almost
useless. It is enough to create these internal tables directly, and
indeed do so in several places.
https://github.com/rails/rails/blob/v5.0.1/activerecord/lib/active_record/schema.rb#L55
https://github.com/rails/rails/blob/v5.0.1/activerecord/lib/active_record/railties/databases.rake#L6
https://github.com/rails/rails/blob/v5.0.1/activerecord/lib/active_record/tasks/database_tasks.rb#L230
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 10 | ||||
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/schema.rb | 2 |
3 files changed, 3 insertions, 13 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 1bdc086380..95725cd883 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -1008,16 +1008,6 @@ module ActiveRecord end end - # Should not be called normally, but this operation is non-destructive. - # The migrations module handles this automatically. - def initialize_schema_migrations_table - ActiveRecord::SchemaMigration.create_table - end - - def initialize_internal_metadata_table - ActiveRecord::InternalMetadata.create_table - end - def internal_string_options_for_primary_key # :nodoc: { primary_key: true } end diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 31c2397bc9..339332a60d 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -1107,8 +1107,8 @@ module ActiveRecord validate(@migrations) - Base.connection.initialize_schema_migrations_table - Base.connection.initialize_internal_metadata_table + ActiveRecord::SchemaMigration.create_table + ActiveRecord::InternalMetadata.create_table end def current_version diff --git a/activerecord/lib/active_record/schema.rb b/activerecord/lib/active_record/schema.rb index 7a2bc9c8af..5104427339 100644 --- a/activerecord/lib/active_record/schema.rb +++ b/activerecord/lib/active_record/schema.rb @@ -48,7 +48,7 @@ module ActiveRecord instance_eval(&block) if info[:version].present? - initialize_schema_migrations_table + ActiveRecord::SchemaMigration.create_table connection.assume_migrated_upto_version(info[:version], migrations_paths) end |