3 class RefactorMapBugTables < ActiveRecord::Migration
5 create_table :map_bug_comment do |t|
6 t.column :id, :bigint, :null => false
7 t.column :bug_id, :bigint, :null => false
8 t.boolean :visible, :null => false
9 t.datetime :date_created, :null => false
10 t.string :commenter_name
11 t.string :commenter_ip
12 t.column :commenter_id, :bigint
16 remove_column :map_bugs, :text
18 add_index :map_bug_comment, [:bug_id], :name => "map_bug_comment_id_idx"
20 add_foreign_key :map_bug_comment, [:bug_id], :map_bugs, [:id]
21 add_foreign_key :map_bug_comment, [:commenter_id], :users, [:id]
25 remove_foreign_key :map_bug_comment, [:commenter_id]
26 remove_foreign_key :map_bug_comment, [:bug_id]
28 remove_index :map_bugs, :name => "map_bug_comment_id_idx"
30 add_column :map_bugs, :text, :string
32 drop_table :map_bug_comment