X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/b9c9d6c1aafdd60c72b54345b4d2dc94317298a0..676e624928b220fded59229738b8ae0cca744cef:/db/migrate/053_add_map_bug_tables.rb diff --git a/db/migrate/053_add_map_bug_tables.rb b/db/migrate/053_add_map_bug_tables.rb index 2d3b7348b..6851a20b4 100644 --- a/db/migrate/053_add_map_bug_tables.rb +++ b/db/migrate/053_add_map_bug_tables.rb @@ -1,12 +1,10 @@ -require 'lib/migrate' +require 'migrate' class AddMapBugTables < ActiveRecord::Migration def self.up - - create_enumeration :map_bug_status_enum, ["open", "closed","hidden"] + create_enumeration :map_bug_status_enum, ["open", "closed", "hidden"] create_table :map_bugs do |t| - t.column :id, :bigint, :null => false t.integer :latitude, :null => false t.integer :longitude, :null => false t.column :tile, :bigint, :null => false @@ -14,20 +12,23 @@ class AddMapBugTables < ActiveRecord::Migration t.datetime :date_created, :null => false t.string :nearby_place t.string :text - t.column :status, :map_bug_status_enum, :null => false - + t.column :status, :map_bug_status_enum, :null => false end - add_index :map_bugs, [:tile,:status], :name => "map_bugs_tile_idx" - add_index :map_bugs, [:last_changed], :name => "map_bugs_changed_idx" - add_index :map_bugs, [:date_created], :name => "map_bugs_created_idx" + change_column :map_bugs, :id, :bigint + + add_index :map_bugs, [:tile, :status], :name => "map_bugs_tile_idx" + add_index :map_bugs, [:last_changed], :name => "map_bugs_changed_idx" + add_index :map_bugs, [:date_created], :name => "map_bugs_created_idx" end def self.down remove_index :map_bugs, :name => "map_bugs_tile_idx" - remove_index :map_bugs, :name => "map_bugs_changed_idx" - remove_index :map_bugs, :name => "map_bugs_created_idx" + remove_index :map_bugs, :name => "map_bugs_changed_idx" + remove_index :map_bugs, :name => "map_bugs_created_idx" + drop_table :map_bugs - drop_enumeration :map_bug_status_enum + + drop_enumeration :map_bug_status_enum end end