Skip to content

Instantly share code, notes, and snippets.

@edavis10
Created September 11, 2009 01:59
Show Gist options
  • Save edavis10/185006 to your computer and use it in GitHub Desktop.
Save edavis10/185006 to your computer and use it in GitHub Desktop.
$ rake db:show_me_a_migration
(in /home/edavis/dev/redmine/redmine-core)
Found 62 Models
class AddMissingIndexes < ActiveRecord::Migration
def self.up
add_index :custom_fields_projects, :
add_index :custom_fields_projects, :custom_field_id
add_index :workflows, :new_status_id
add_index :deliverables, :type
add_index :deliverables, :project_id
add_index :repositories, :project_id
add_index :messages, :last_reply_id
add_index :messages, :author_id
add_index :comments, :commented_type
add_index :comments, :commented_id
add_index :comments, :author_id
add_index :questions, :journal_id
add_index :questions, :assigned_to_id
add_index :questions, :author_id
add_index :questions, :issue_id
add_index :auth_sources, :type
add_index :watchers, :watchable_id
add_index :wiki_pages, :parent_id
add_index :enumerations, :type
add_index :scores, :score_group_id
add_index :scores, :project_id
add_index :changesets_issues, :
add_index :tokens, :user_id
add_index :projects_trackers, :
add_index :documents, :category_id
add_index :payments, :invoice_id
add_index :changesets, :user_id
add_index :issues, :status_id
add_index :issues, :tracker_id
add_index :issues, :deliverable_id
add_index :issues, :fixed_version_id
add_index :issues, :assigned_to_id
add_index :issues, :category_id
add_index :issues, :priority_id
add_index :issues, :author_id
add_index :user_preferences, :user_id
add_index :boards, :last_message_id
add_index :member_roles, :role_id
add_index :member_roles, :member_id
add_index :issue_categories, :assigned_to_id
add_index :custom_fields, :type
add_index :members, :user_id
add_index :members, :project_id
add_index :news, :author_id
add_index :users, :auth_source_id
add_index :time_entries, :user_id
add_index :time_entries, :activity_id
add_index :queries, :user_id
add_index :queries, :project_id
add_index :custom_values, :custom_field_id
add_index :wiki_contents, :author_id
add_index :attachments, :container_type
add_index :attachments, :container_id
add_index :attachments, :author_id
add_index :custom_fields_trackers, :
add_index :custom_fields_trackers, :custom_field_id
add_index :issue_relations, :issue_from_id
add_index :issue_relations, :issue_to_id
add_index :journals, :user_id
add_index :journals, :journalized_id
add_index :invoices, :customer_id
add_index :invoices, :project_id
add_index :score_options, :score_group_id
end
def self.down
remove_index :custom_fields_projects, :
remove_index :custom_fields_projects, :custom_field_id
remove_index :workflows, :new_status_id
remove_index :deliverables, :type
remove_index :deliverables, :project_id
remove_index :repositories, :project_id
remove_index :messages, :last_reply_id
remove_index :messages, :author_id
remove_index :comments, :commented_type
remove_index :comments, :commented_id
remove_index :comments, :author_id
remove_index :questions, :journal_id
remove_index :questions, :assigned_to_id
remove_index :questions, :author_id
remove_index :questions, :issue_id
remove_index :auth_sources, :type
remove_index :watchers, :watchable_id
remove_index :wiki_pages, :parent_id
remove_index :enumerations, :type
remove_index :scores, :score_group_id
remove_index :scores, :project_id
remove_index :changesets_issues, :
remove_index :tokens, :user_id
remove_index :projects_trackers, :
remove_index :documents, :category_id
remove_index :payments, :invoice_id
remove_index :changesets, :user_id
remove_index :issues, :status_id
remove_index :issues, :tracker_id
remove_index :issues, :deliverable_id
remove_index :issues, :fixed_version_id
remove_index :issues, :assigned_to_id
remove_index :issues, :category_id
remove_index :issues, :priority_id
remove_index :issues, :author_id
remove_index :user_preferences, :user_id
remove_index :boards, :last_message_id
remove_index :member_roles, :role_id
remove_index :member_roles, :member_id
remove_index :issue_categories, :assigned_to_id
remove_index :custom_fields, :type
remove_index :members, :user_id
remove_index :members, :project_id
remove_index :news, :author_id
remove_index :users, :auth_source_id
remove_index :time_entries, :user_id
remove_index :time_entries, :activity_id
remove_index :queries, :user_id
remove_index :queries, :project_id
remove_index :custom_values, :custom_field_id
remove_index :wiki_contents, :author_id
remove_index :attachments, :container_type
remove_index :attachments, :container_id
remove_index :attachments, :author_id
remove_index :custom_fields_trackers, :
remove_index :custom_fields_trackers, :custom_field_id
remove_index :issue_relations, :issue_from_id
remove_index :issue_relations, :issue_to_id
remove_index :journals, :user_id
remove_index :journals, :journalized_id
remove_index :invoices, :customer_id
remove_index :invoices, :project_id
remove_index :score_options, :score_group_id
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment