]> git.openstreetmap.org Git - rails.git/blob - db/migrate/20110521142405_rename_bugs_to_notes.rb
Update to rails 6.0.3.7
[rails.git] / db / migrate / 20110521142405_rename_bugs_to_notes.rb
1 class RenameBugsToNotes < ActiveRecord::Migration[4.2]
2   def self.up
3     rename_enumeration "map_bug_status_enum", "note_status_enum"
4     rename_enumeration "map_bug_event_enum", "note_event_enum"
5
6     rename_table :map_bugs, :notes
7     rename_index :notes, "map_bugs_changed_idx", "notes_updated_at_idx"
8     rename_index :notes, "map_bugs_created_idx", "notes_created_at_idx"
9     rename_index :notes, "map_bugs_tile_idx", "notes_tile_status_idx"
10
11     rename_table :map_bug_comment, :note_comments
12     rename_column :note_comments, :bug_id, :note_id
13     rename_index :note_comments, "map_bug_comment_id_idx", "note_comments_note_id_idx"
14   end
15
16   def self.down
17     rename_index :note_comments, "note_comments_note_id_idx", "map_bug_comment_id_idx"
18     rename_column :note_comments, :note_id, :bug_id
19     rename_table :note_comments, :map_bug_comment
20
21     rename_index :notes, "notes_tile_status_idx", "map_bugs_tile_idx"
22     rename_index :notes, "notes_created_at_idx", "map_bugs_created_idx"
23     rename_index :notes, "notes_updated_at_idx", "map_bugs_changed_idx"
24     rename_table :notes, :map_bugs
25
26     rename_enumeration "note_event_enum", "map_bug_event_enum"
27     rename_enumeration "note_status_enum", "map_bug_status_enum"
28   end
29 end