File tree Expand file tree Collapse file tree 4 files changed +20
-12
lines changed
connection_adapters/abstract Expand file tree Collapse file tree 4 files changed +20
-12
lines changed Original file line number Diff line number Diff line change 1+ * Deprecate passing ` migrations_paths ` to ` connection.assume_migrated_upto_version ` .
2+
3+ * Ryuta Kamizono*
4+
15* MySQL: ` ROW_FORMAT=DYNAMIC ` create table option by default.
26
37 Since MySQL 5.7.9, the ` innodb_default_row_format ` option defines the default row
Original file line number Diff line number Diff line change 22
33require "active_record/migration/join_table"
44require "active_support/core_ext/string/access"
5+ require "active_support/deprecation"
56require "digest/sha2"
67
78module ActiveRecord
@@ -1050,8 +1051,13 @@ def internal_string_options_for_primary_key # :nodoc:
10501051 { primary_key : true }
10511052 end
10521053
1053- def assume_migrated_upto_version ( version , migrations_paths )
1054- migrations_paths = Array ( migrations_paths )
1054+ def assume_migrated_upto_version ( version , migrations_paths = nil )
1055+ unless migrations_paths . nil?
1056+ ActiveSupport ::Deprecation . warn ( <<~MSG )
1057+ Passing migrations_paths to #assume_migrated_upto_version is deprecated and will be removed in Rails 6.1.
1058+ MSG
1059+ end
1060+
10551061 version = version . to_i
10561062 sm_table = quote_table_name ( ActiveRecord ::SchemaMigration . table_name )
10571063
Original file line number Diff line number Diff line change @@ -51,20 +51,11 @@ def define(info, &block) # :nodoc:
5151
5252 if info [ :version ] . present?
5353 ActiveRecord ::SchemaMigration . create_table
54- connection . assume_migrated_upto_version ( info [ :version ] , migrations_paths )
54+ connection . assume_migrated_upto_version ( info [ :version ] )
5555 end
5656
5757 ActiveRecord ::InternalMetadata . create_table
5858 ActiveRecord ::InternalMetadata [ :environment ] = connection . migration_context . current_environment
5959 end
60-
61- private
62- # Returns the migrations paths.
63- #
64- # ActiveRecord::Schema.new.migrations_paths
65- # # => ["db/migrate"] # Rails migration path by default.
66- def migrations_paths
67- ActiveRecord ::Migrator . migrations_paths
68- end
6960 end
7061end
Original file line number Diff line number Diff line change @@ -71,6 +71,13 @@ def setup
7171 ActiveRecord ::Migration . verbose = @verbose_was
7272 end
7373
74+ def test_passing_migrations_paths_to_assume_migrated_upto_version_is_deprecated
75+ ActiveRecord ::SchemaMigration . create_table
76+ assert_deprecated do
77+ ActiveRecord ::Base . connection . assume_migrated_upto_version ( 0 , [ ] )
78+ end
79+ end
80+
7481 def test_migrator_migrations_path_is_deprecated
7582 assert_deprecated do
7683 ActiveRecord ::Migrator . migrations_path = "/whatever"
You can’t perform that action at this time.
0 commit comments