Created
November 8, 2018 20:06
-
-
Save afcapel/5111895daafedb087171bfc8a3b56fa2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.eager_load! | |
ActiveRecord::Base.descendants.each do |model| | |
next unless model.table_exists? | |
model.columns.each do |col| | |
next unless col.name =~ /_?id\Z/ | |
if col.type == :integer && col.sql_type != "bigint" | |
puts "#{model.table_name} #{col.name} is of type #{col.sql_type} but should be bigint" | |
end | |
end | |
end; nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment