]> git.openstreetmap.org Git - rails.git/blobdiff - db/migrate/20150526130032_create_issue_comments.rb
Proper implementation of report strings + cleaning up
[rails.git] / db / migrate / 20150526130032_create_issue_comments.rb
index 92b328f9ab4cd0e9685d5610ec1f0f2c80efd3da..688fa2b996a66f146d9645c65be685aefc5152fa 100644 (file)
@@ -2,11 +2,18 @@ class CreateIssueComments < ActiveRecord::Migration
   def change
     create_table :issue_comments do |t|
       t.integer :issue_id
-      t.integer :user_id
+      t.integer :commenter_user_id
       t.text :body
       t.datetime :created_at
 
       t.timestamps null: false
     end
+
+       add_foreign_key :issue_comments, :issues, :name => "issue_comments_issue_id_fkey"
+       add_foreign_key :issue_comments, :users,:column => :commenter_user_id, :name => "issue_comments_commenter_user_id"
+
+       add_index :issue_comments, :commenter_user_id
+       add_index :issue_comments, :issue_id
+
   end
 end