3 class CreateIssues < ActiveRecord::Migration
5 create_table :issues do |t|
6 t.string :reportable_type, :null => false
7 t.integer :reportable_id, :null => false
8 t.integer :reported_user_id, :null => false
10 t.datetime :resolved_at
11 t.integer :resolved_by
12 t.datetime :created_at
13 t.datetime :updated_at
15 t.timestamps null: false
18 add_foreign_key :issues, :users, :column => :reported_user_id,:name => "issues_reported_user_id_fkey"
20 add_index :issues, :reported_user_id
21 add_index :issues, [:reportable_id, :reportable_type]