]> git.openstreetmap.org Git - rails.git/blob - db/migrate/016_add_changesets.rb
api06: Fix bounds check.
[rails.git] / db / migrate / 016_add_changesets.rb
1 class AddChangesets < ActiveRecord::Migration
2   def self.up
3     create_table "changesets", innodb_table do |t|
4       t.column "id",             :bigint,   :limit => 20, :null => false
5       t.column "user_id",        :bigint,   :limit => 20, :null => false
6       t.column "created_at",     :datetime,               :null => false
7       t.column "open",           :boolean,                :null => false, :default => true
8       t.column "min_lat",        :integer,                :null => true
9       t.column "max_lat",        :integer,                :null => true
10       t.column "min_lon",        :integer,                :null => true
11       t.column "max_lon",        :integer,                :null => true
12     end
13
14     add_primary_key "changesets", ["id"]
15     # FIXME add indexes?
16
17     change_column "changesets", "id", :bigint, :limit => 20, :null => false, :options => "AUTO_INCREMENT"
18
19     create_table "changeset_tags", innodb_table do |t|
20       t.column "id", :bigint, :limit => 64, :null => false
21       t.column "k",  :string, :default => "", :null => false
22       t.column "v",  :string, :default => "", :null => false
23     end
24
25     add_index "changeset_tags", ["id"], :name => "changeset_tags_id_idx"
26   end
27
28   def self.down
29     drop_table "changesets"
30     drop_table "changeset_tags"
31   end
32 end