Exception: ActiveRecord::InvalidMigrationTimestampError

Inherits:
MigrationError show all
Defined in:
lib/active_record/migration.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(version = nil, name = nil) ⇒ InvalidMigrationTimestampError

Returns a new instance of InvalidMigrationTimestampError.



133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/active_record/migration.rb', line 133

def initialize(version = nil, name = nil)
  if version && name
    super(<<~MSG)
      Invalid timestamp #{version} for migration file: #{name}.
      Timestamp must be in form YYYYMMDDHHMMSS, and less than #{(Time.now.utc + 1.day).strftime("%Y%m%d%H%M%S")}.
    MSG
  else
    super(<<~MSG)
      Invalid timestamp for migration.
      Timestamp must be in form YYYYMMDDHHMMSS, and less than #{(Time.now.utc + 1.day).strftime("%Y%m%d%H%M%S")}.
    MSG
  end
end