3 class CreateChangesetComments < ActiveRecord::Migration
5 create_table :changeset_comments do |t|
6 t.column :changeset_id, :bigint, :null => false
7 t.column :author_id, :bigint, :null => false
8 t.text :body, :null => false
9 t.timestamp :created_at, :null => false
10 t.boolean :visible, :null => false
13 add_foreign_key :changeset_comments, [:changeset_id], :changesets, [:id]
14 add_foreign_key :changeset_comments, [:author_id], :users, [:id]
16 add_index :changeset_comments, :created_at