X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7dbf8d83369cb73929080c4ba23fdd7dcd0184df..84844514fd691def2be3d451ca08e24e33ab9108:/db/migrate/20160822153055_create_issues_and_reports.rb?ds=sidebyside diff --git a/db/migrate/20160822153055_create_issues_and_reports.rb b/db/migrate/20160822153055_create_issues_and_reports.rb index b03ac24a8..07a549820 100644 --- a/db/migrate/20160822153055_create_issues_and_reports.rb +++ b/db/migrate/20160822153055_create_issues_and_reports.rb @@ -1,5 +1,3 @@ -require "migrate" - class CreateIssuesAndReports < ActiveRecord::Migration[5.0] def up create_enumeration :issue_status_enum, %w[open ignored resolved] @@ -21,9 +19,11 @@ class CreateIssuesAndReports < ActiveRecord::Migration[5.0] add_foreign_key :issues, :users, :column => :resolved_by, :name => "issues_resolved_by_fkey" add_foreign_key :issues, :users, :column => :updated_by, :name => "issues_updated_by_fkey" - add_index :issues, :reported_user_id add_index :issues, [:reportable_type, :reportable_id] - add_index :issues, :updated_by + add_index :issues, [:reported_user_id] + add_index :issues, [:status] + add_index :issues, [:assigned_role] + add_index :issues, [:updated_by] create_table :reports do |t| t.integer :issue_id, :null => false @@ -36,8 +36,8 @@ class CreateIssuesAndReports < ActiveRecord::Migration[5.0] add_foreign_key :reports, :issues, :name => "reports_issue_id_fkey" add_foreign_key :reports, :users, :column => :user_id, :name => "reports_user_id_fkey" - add_index :reports, :user_id add_index :reports, :issue_id + add_index :reports, :user_id create_table :issue_comments do |t| t.integer :issue_id, :null => false @@ -49,8 +49,8 @@ class CreateIssuesAndReports < ActiveRecord::Migration[5.0] add_foreign_key :issue_comments, :issues, :name => "issue_comments_issue_id_fkey" add_foreign_key :issue_comments, :users, :column => :user_id, :name => "issue_comments_user_id_fkey" - add_index :issue_comments, :user_id add_index :issue_comments, :issue_id + add_index :issue_comments, :user_id end def down