3 class RenameBugsToNotes < ActiveRecord::Migration
5 rename_enumeration "map_bug_status_enum", "note_status_enum"
6 rename_enumeration "map_bug_event_enum", "note_event_enum"
8 rename_table :map_bugs, :notes
9 rename_sequence :notes, "map_bugs_id_seq", "notes_id_seq"
10 rename_index :notes, "map_bugs_pkey", "notes_pkey"
11 rename_index :notes, "map_bugs_changed_idx", "notes_updated_at_idx"
12 rename_index :notes, "map_bugs_created_idx", "notes_created_at_idx"
13 rename_index :notes, "map_bugs_tile_idx", "notes_tile_status_idx"
15 remove_foreign_key :map_bug_comment, [:bug_id], :map_bugs, [:id]
16 rename_column :map_bug_comment, :author_id, :commenter_id
17 remove_foreign_key :map_bug_comment, [:commenter_id], :users, [:id]
18 rename_column :map_bug_comment, :commenter_id, :author_id
20 rename_table :map_bug_comment, :note_comments
21 rename_column :note_comments, :bug_id, :note_id
22 rename_sequence :note_comments, "map_bug_comment_id_seq", "note_comments_id_seq"
23 rename_index :note_comments, "map_bug_comment_pkey", "note_comments_pkey"
24 rename_index :note_comments, "map_bug_comment_id_idx", "note_comments_note_id_idx"
26 add_foreign_key :note_comments, [:note_id], :notes, [:id]
27 add_foreign_key :note_comments, [:author_id], :users, [:id]
31 remove_foreign_key :note_comments, [:author_id], :users, [:id]
32 remove_foreign_key :note_comments, [:note_id], :notes, [:id]
34 rename_index :note_comments, "note_comments_note_id_idx", "map_bug_comment_id_idx"
35 rename_index :notes, "note_comments_pkey", "map_bug_comment_pkey"
36 rename_column :note_comments, :note_id, :bug_id
37 rename_sequence :note_comments, "note_comments_id_seq", "map_bug_comment_id_seq"
38 rename_table :note_comments, :map_bug_comment
40 rename_column :map_bug_comment, :author_id, :commenter_id
41 add_foreign_key :map_bug_comment, [:commenter_id], :users, [:id]
42 rename_column :map_bug_comment, :commenter_id, :author_id
43 add_foreign_key :map_bug_comment, [:bug_id], :notes, [:id]
45 rename_index :notes, "notes_tile_status_idx", "map_bugs_tile_idx"
46 rename_index :notes, "notes_created_at_idx", "map_bugs_created_idx"
47 rename_index :notes, "notes_updated_at_idx", "map_bugs_changed_idx"
48 rename_index :notes, "notes_pkey", "map_bugs_pkey"
49 rename_sequence :notes, "notes_id_seq", "map_bugs_id_seq"
50 rename_table :notes, :map_bugs
52 rename_enumeration "note_event_enum", "map_bug_event_enum"
53 rename_enumeration "note_status_enum", "map_bug_status_enum"