-
-
Save jyr/cea38aa1f9c521c404d7114541a6ced9 to your computer and use it in GitHub Desktop.
Revisions
-
tomafro created this gist
Sep 22, 2009 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ attachments: parent_id, asset_id domain_names: organisation_id event_memberships: user_id, event_id events: editor_id group_actions: user_id, group_id groups: user_id icons: parent_id invitations: sender_id legacy_actions: item_upon_id news_items: author_id organisations: midas_id pages: author_id pending_event_memberships: invitation_id, event_id resources: user_id, resourceable_id subscriptions: subscribable_id, user_id taggings: tag_id, taggable_id, user_id This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ c = ActiveRecord::Base.connection c.tables.collect do |t| columns = c.columns(t).collect(&:name).select {|x| x.ends_with?("_id" || x.ends_with("_type"))} indexed_columns = c.indexes(t).collect(&:columns).flatten.uniq unindexed = columns - indexed_columns unless unindexed.empty? puts "#{t}: #{unindexed.join(", ")}" end end