]> git.openstreetmap.org Git - rails.git/commitdiff
Drop renaming of sequences
authorTom Hughes <tom@compton.nu>
Sat, 13 Oct 2012 10:48:13 +0000 (11:48 +0100)
committerTom Hughes <tom@compton.nu>
Sat, 13 Oct 2012 10:49:37 +0000 (11:49 +0100)
Rails seems to rename sequences automatically now when the
corresponding table is renamed, so we don't need to do it.

db/migrate/20110521142405_rename_bugs_to_notes.rb
lib/migrate.rb

index d276bf0576e2633128a80636e9cc619025be0256..2934b73fd7a978b74885dee9413d282a19bea9aa 100644 (file)
@@ -6,7 +6,6 @@ class RenameBugsToNotes < ActiveRecord::Migration
     rename_enumeration "map_bug_event_enum", "note_event_enum"
 
     rename_table :map_bugs, :notes
-    rename_sequence :notes, "map_bugs_id_seq", "notes_id_seq"
     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"
@@ -19,7 +18,6 @@ class RenameBugsToNotes < ActiveRecord::Migration
 
     rename_table :map_bug_comment, :note_comments
     rename_column :note_comments, :bug_id, :note_id
-    rename_sequence :note_comments, "map_bug_comment_id_seq", "note_comments_id_seq"
     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"
 
@@ -34,7 +32,6 @@ class RenameBugsToNotes < ActiveRecord::Migration
     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_sequence :note_comments, "note_comments_id_seq", "map_bug_comment_id_seq"
     rename_table :note_comments, :map_bug_comment
 
     rename_column :map_bug_comment, :author_id, :commenter_id
@@ -46,7 +43,6 @@ class RenameBugsToNotes < ActiveRecord::Migration
     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_sequence :notes, "notes_id_seq", "map_bugs_id_seq"
     rename_table :notes, :map_bugs
 
     rename_enumeration "note_event_enum", "map_bug_event_enum"
index 75e047815a073004eb8f5c7fc8467f1840a9f944..baa7faecde3703d438548bb6c210ad812434d682 100644 (file)
@@ -134,10 +134,6 @@ module ActiveRecord
       def rename_index(table_name, old_name, new_name)
         execute "ALTER INDEX #{quote_table_name(old_name)} RENAME TO #{quote_table_name(new_name)}"
       end
-
-      def rename_sequence(table_name, old_name, new_name)
-        execute "ALTER SEQUENCE #{quote_table_name(old_name)} RENAME TO #{quote_table_name(new_name)}"
-      end
     end
   end
 end