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