3 class RefactorMapBugTables < ActiveRecord::Migration
7 create_table :map_bug_comment do |t|
8 t.column :id, :bigint, :null => false
9 t.column :bug_id, :bigint, :null => false
10 t.boolean :visible, :null => false
11 t.datetime :date_created, :null => false
12 t.string :commenter_name
13 t.string :commenter_ip
14 t.column :commenter_id, :bigint
18 remove_column :map_bugs, :text
20 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]
28 add_column :map_bugs, :text, :string
30 remove_index :map_bugs, :name => "map_bug_comment_id_idx"
31 remove_foreign_key :map_bug_comment, [:bug_id]
32 remove_foreign_key :map_bug_comment, [:commenter_id]
34 drop_table :map_bugs_comment