3 class RefactorMapBugTables < ActiveRecord::Migration
5 create_table :map_bug_comment do |t|
6 t.column :bug_id, :bigint, :null => false
7 t.boolean :visible, :null => false
8 t.datetime :date_created, :null => false
9 t.string :commenter_name
10 t.string :commenter_ip
11 t.column :commenter_id, :bigint
15 remove_column :map_bugs, :text
17 change_column :map_bug_comment, :id, :bigint
19 add_index :map_bug_comment, [:bug_id], :name => "map_bug_comment_id_idx"
21 add_foreign_key :map_bug_comment, [:bug_id], :map_bugs, [:id]
22 add_foreign_key :map_bug_comment, [:commenter_id], :users, [:id]
26 remove_foreign_key :map_bug_comment, [:commenter_id]
27 remove_foreign_key :map_bug_comment, [:bug_id]
29 remove_index :map_bugs, :name => "map_bug_comment_id_idx"
31 add_column :map_bugs, :text, :string
33 drop_table :map_bug_comment