mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Revert "Merge pull request #43604 from nikonoid/bug/31722"
This reverts commit2374f0efed
, reversing changes made tob37c02e027
. Since this break existing applications, and is necesary only because applications are not using timestamped migrations and are expecting it to just work, I decided to not revert this. Those application should either follow the timestamped migrations format or disable it.
This commit is contained in:
parent
104c14fbda
commit
b2350f28dd
2 changed files with 1 additions and 10 deletions
|
@ -1001,7 +1001,7 @@ module ActiveRecord
|
|||
# Determines the version number of the next migration.
|
||||
def next_migration_number(number)
|
||||
if ActiveRecord.timestamped_migrations
|
||||
[Time.now.utc.strftime("%Y%m%d%H%M%S").to_i, ("%.14d" % number).to_i].max
|
||||
[Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % number].max
|
||||
else
|
||||
SchemaMigration.normalize_migration_number(number)
|
||||
end
|
||||
|
|
|
@ -148,15 +148,6 @@ class MigrationTest < ActiveRecord::TestCase
|
|||
assert_equal 20131219224947, migrator.current_version
|
||||
end
|
||||
|
||||
def test_migration_next_migration_number_consistent_across_year_boundary
|
||||
last_year = Time.now.year - 1
|
||||
not_a_month = 14
|
||||
day_of_month = Time.now.day
|
||||
time = Time.now.utc.strftime("%H%M%S")
|
||||
last_year_number = "#{last_year}#{not_a_month}#{day_of_month}#{time}01"
|
||||
assert_equal last_year_number, ActiveRecord::Migration.new.next_migration_number(last_year_number).to_s
|
||||
end
|
||||
|
||||
def test_create_table_raises_if_already_exists
|
||||
connection = Person.connection
|
||||
connection.create_table :testings, force: true do |t|
|
||||
|
|
Loading…
Reference in a new issue