X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/588a65c2b21185c0f080fafae254d601128c38ea..e3bd648182526779781ad309c004f0d3cb4044ff:/db/migrate/015_create_temp_old_nodes.rb diff --git a/db/migrate/015_create_temp_old_nodes.rb b/db/migrate/015_create_temp_old_nodes.rb new file mode 100644 index 000000000..60edb8406 --- /dev/null +++ b/db/migrate/015_create_temp_old_nodes.rb @@ -0,0 +1,24 @@ +class CreateTempOldNodes < ActiveRecord::Migration + def self.up + create_table "temp_nodes", myisam_table do |t| + t.column "id", :bigint, :limit => 64, :null => false + t.column "version", :bigint, :limit => 20, :null => false + t.column "latitude", :double, :null => false + t.column "longitude", :double, :null => false + t.column "user_id", :bigint, :limit => 20, :null => false + t.column "visible", :boolean, :null => false + t.column "timestamp", :datetime, :null => false + t.column "tile", :integer, :null => false + end + + add_primary_key "temp_nodes", ["id", "version"] + add_index "temp_nodes", ["timestamp"], :name => "temp_nodes_timestamp_idx" + add_index "temp_nodes", ["tile"], :name => "temp_nodes_tile_idx" + + change_column "temp_nodes", "version", :bigint, :limit => 20, :null => false, :options => "AUTO_INCREMENT" + end + + def self.down + drop_table :temp_nodes + end +end