]> git.openstreetmap.org Git - rails.git/blob - db/migrate/20160822153115_create_issue_comments.rb
Remove the reassign column from issue_comments
[rails.git] / db / migrate / 20160822153115_create_issue_comments.rb
1 class CreateIssueComments < ActiveRecord::Migration[5.0]
2   def change
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
7       t.timestamps :null => false
8     end
9
10     add_foreign_key :issue_comments, :issues, :name => "issue_comments_issue_id_fkey", :on_delete => :cascade
11     add_foreign_key :issue_comments, :users, :column => :commenter_user_id, :name => "issue_comments_commenter_user_id", :on_delete => :cascade
12
13     add_index :issue_comments, :commenter_user_id
14     add_index :issue_comments, :issue_id
15   end
16 end