1 class CreateIssueComments < ActiveRecord::Migration[5.0]
3 create_table :issue_comments do |t|
4 t.integer :issue_id, :null => false
5 t.integer :commenter_user_id, :null => false
6 t.text :body, :null => false
8 t.timestamps :null => false
11 add_foreign_key :issue_comments, :issues, :name => "issue_comments_issue_id_fkey", :on_delete => :cascade
12 add_foreign_key :issue_comments, :users, :column => :commenter_user_id, :name => "issue_comments_commenter_user_id", :on_delete => :cascade
14 add_index :issue_comments, :commenter_user_id
15 add_index :issue_comments, :issue_id