openstreetmap-website/db/migrate/050_add_map_bug_tables.rb
Kai Krueger 42822a8b89 An initial (incomplete) "proof of concept" integration of an OpenStreetBugs interface into the rails port
This is a (start of a) reimplementation of the api at http://github.com/emka/openstreetbugs/tree/master/api/0.1/
into rails

The client side code is taken from http://wiki.openstreetmap.org/wiki/OpenStreetBugs/New_Client

This is ment as a mockup to perhaps use as a basis to further discuss how best to integrate a map bug reporting system

It currently uses (more or less) the openstreetbugs api specification. But this api feels rather inconsistent with the
rest of the rails_port api, so depending on discussions might still need some significant changes.
2010-02-28 09:30:40 +00:00

33 lines
1 KiB
Ruby

require 'lib/migrate'
class AddMapBugTables < ActiveRecord::Migration
def self.up
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
t.datetime :last_changed, :null => false
t.datetime :date_created, :null => false
t.string :nearby_place
t.string :text
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"
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"
drop_table :map_bugs
drop_enumeration :map_bug_status_enum
end
end