lib/scrivito/migrations/migration.rb in scrivito_sdk-0.30.0.rc1 vs lib/scrivito/migrations/migration.rb in scrivito_sdk-0.30.0
- old
+ new
@@ -46,17 +46,12 @@
migrations.detect do |migration|
migration.name == name && migration.scope == scope.to_s
end
end
- def next_migration_number(max)
- timestamp = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
-
- if max >= timestamp
- timestamp = max + 1
- end
-
- timestamp
+ def next_migration_number(current_migration_number)
+ migration_number = current_migration_number + 1
+ [Time.now.utc.strftime('%Y%m%d%H%M%S'), '%.14d' % migration_number].max
end
end
attr_accessor :name
attr_accessor :version