lib/generators/pghero/query_stats_generator.rb in pghero-1.6.5 vs lib/generators/pghero/query_stats_generator.rb in pghero-1.7.0
- old
+ new
@@ -20,10 +20,16 @@
"%.3d" % next_migration_number
end
end
def copy_migration
- migration_template "query_stats.rb", "db/migrate/create_pghero_query_stats.rb"
+ migration_template "query_stats.rb", "db/migrate/create_pghero_query_stats.rb", migration_version: migration_version
+ end
+
+ def migration_version
+ if ActiveRecord::VERSION::MAJOR >= 5
+ "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
+ end
end
end
end
end