X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/56db9ca2b7e2475cd8025630049fb4a4b824f2d9..212ace7ef1bbf2332145d65a09fbb7454d3348ec:/db/migrate/20110521142405_rename_bugs_to_notes.rb?ds=sidebyside diff --git a/db/migrate/20110521142405_rename_bugs_to_notes.rb b/db/migrate/20110521142405_rename_bugs_to_notes.rb index 2934b73fd..2e90b5ce8 100644 --- a/db/migrate/20110521142405_rename_bugs_to_notes.rb +++ b/db/migrate/20110521142405_rename_bugs_to_notes.rb @@ -1,51 +1,29 @@ -require 'migrate' - -class RenameBugsToNotes < ActiveRecord::Migration +class RenameBugsToNotes < ActiveRecord::Migration[4.2] def self.up - rename_enumeration "map_bug_status_enum", "note_status_enum" - rename_enumeration "map_bug_event_enum", "note_event_enum" + rename_enum "map_bug_status_enum", :to => "note_status_enum" + rename_enum "map_bug_event_enum", :to => "note_event_enum" rename_table :map_bugs, :notes - rename_index :notes, "map_bugs_pkey", "notes_pkey" rename_index :notes, "map_bugs_changed_idx", "notes_updated_at_idx" rename_index :notes, "map_bugs_created_idx", "notes_created_at_idx" rename_index :notes, "map_bugs_tile_idx", "notes_tile_status_idx" - remove_foreign_key :map_bug_comment, [:bug_id], :map_bugs, [:id] - rename_column :map_bug_comment, :author_id, :commenter_id - remove_foreign_key :map_bug_comment, [:commenter_id], :users, [:id] - rename_column :map_bug_comment, :commenter_id, :author_id - rename_table :map_bug_comment, :note_comments rename_column :note_comments, :bug_id, :note_id - rename_index :note_comments, "map_bug_comment_pkey", "note_comments_pkey" rename_index :note_comments, "map_bug_comment_id_idx", "note_comments_note_id_idx" - - add_foreign_key :note_comments, [:note_id], :notes, [:id] - add_foreign_key :note_comments, [:author_id], :users, [:id] end def self.down - remove_foreign_key :note_comments, [:author_id], :users, [:id] - remove_foreign_key :note_comments, [:note_id], :notes, [:id] - rename_index :note_comments, "note_comments_note_id_idx", "map_bug_comment_id_idx" - rename_index :notes, "note_comments_pkey", "map_bug_comment_pkey" rename_column :note_comments, :note_id, :bug_id rename_table :note_comments, :map_bug_comment - rename_column :map_bug_comment, :author_id, :commenter_id - add_foreign_key :map_bug_comment, [:commenter_id], :users, [:id] - rename_column :map_bug_comment, :commenter_id, :author_id - add_foreign_key :map_bug_comment, [:bug_id], :notes, [:id] - rename_index :notes, "notes_tile_status_idx", "map_bugs_tile_idx" rename_index :notes, "notes_created_at_idx", "map_bugs_created_idx" rename_index :notes, "notes_updated_at_idx", "map_bugs_changed_idx" - rename_index :notes, "notes_pkey", "map_bugs_pkey" rename_table :notes, :map_bugs - rename_enumeration "note_event_enum", "map_bug_event_enum" - rename_enumeration "note_status_enum", "map_bug_status_enum" + rename_enum "note_event_enum", :to => "map_bug_event_enum" + rename_enum "note_status_enum", :to => "map_bug_status_enum" end end