]> git.openstreetmap.org Git - rails.git/blobdiff - db/migrate/054_refactor_map_bug_tables.rb
Fix require paths in migrations
[rails.git] / db / migrate / 054_refactor_map_bug_tables.rb
index b45f935cc32c7db4daa847579ec0894a4bc0ab42..b094cc593e7d93435f609b166ae6f7225285128e 100644 (file)
@@ -1,36 +1,34 @@
-require 'lib/migrate'
+require 'migrate'
 
 class RefactorMapBugTables < ActiveRecord::Migration
   def self.up
-
-
     create_table :map_bug_comment do |t|
       t.column :id, :bigint, :null => false
-         t.column :bug_id, :bigint, :null => false
+      t.column :bug_id, :bigint, :null => false
       t.boolean :visible, :null => false 
       t.datetime :date_created, :null => false
-         t.string :commenter_name
-         t.string :commenter_ip
-         t.column :commenter_id, :bigint
+      t.string :commenter_name
+      t.string :commenter_ip
+      t.column :commenter_id, :bigint
       t.string :comment
     end
 
-       remove_column :map_bugs, :text 
+    remove_column :map_bugs, :text 
 
     add_index :map_bug_comment, [:bug_id], :name => "map_bug_comment_id_idx"
-       add_foreign_key :map_bug_comment, [:bug_id], :map_bugs, [:id]
-       add_foreign_key :map_bug_comment, [:commenter_id], :users, [:id]
 
+    add_foreign_key :map_bug_comment, [:bug_id], :map_bugs, [:id]
+    add_foreign_key :map_bug_comment, [:commenter_id], :users, [:id]
   end
 
   def self.down
-
-       add_column :map_bugs, :text, :string
+    remove_foreign_key :map_bug_comment, [:commenter_id]
+    remove_foreign_key :map_bug_comment, [:bug_id]
 
     remove_index :map_bugs, :name => "map_bug_comment_id_idx"
-       remove_foreign_key :map_bug_comment, [:bug_id]
-       remove_foreign_key :map_bug_comment, [:commenter_id]
 
-    drop_table :map_bugs_comment
+    add_column :map_bugs, :text, :string
+
+    drop_table :map_bug_comment
   end
 end