diff --git a/lib/generators/has_friendship/has_friendship_generator.rb b/lib/generators/has_friendship/has_friendship_generator.rb index 304a605..407ece5 100644 --- a/lib/generators/has_friendship/has_friendship_generator.rb +++ b/lib/generators/has_friendship/has_friendship_generator.rb @@ -9,7 +9,10 @@ def self.source_root end def self.next_migration_number(path) - Time.now.utc.strftime("%Y%m%d%H%M%S") + next_num = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i + current_num = current_migration_number(path) + next_num += (current_num - next_num + 1) if current_num >= next_num + next_num.to_s end def create_migration_file