]> git.openstreetmap.org Git - rails.git/blob - db/migrate/20160822153115_create_issue_comments.rb
Reordered migrations to make them the latest.
[rails.git] / db / migrate / 20160822153115_create_issue_comments.rb
1 class CreateIssueComments < ActiveRecord::Migration
2   def change
3     create_table :issue_comments do |t|
4       t.integer :issue_id
5       t.integer :commenter_user_id
6       t.text :body
7       t.datetime :created_at
8       t.boolean :reassign
9       t.timestamps null: false
10     end
11
12         add_foreign_key :issue_comments, :issues, :name => "issue_comments_issue_id_fkey", on_delete: :cascade
13         add_foreign_key :issue_comments, :users,:column => :commenter_user_id, :name => "issue_comments_commenter_user_id", on_delete: :cascade
14
15         add_index :issue_comments, :commenter_user_id
16         add_index :issue_comments, :issue_id
17
18   end
19 end