3 class CleanupOsmDb < ActiveRecord::Migration
5 change_column "current_nodes", "latitude", :double, :null => false
6 change_column "current_nodes", "longitude", :double, :null => false
7 change_column "current_nodes", "user_id", :bigint, :limit => 20, :null => false
8 change_column "current_nodes", "visible", :boolean, :null => false
9 change_column "current_nodes", "timestamp", :datetime, :null => false
10 add_primary_key "current_nodes", ["id"]
11 remove_index "current_nodes", :name => "current_nodes_id_idx"
13 change_column "current_segments", "node_a", :bigint, :limit => 64, :null => false
14 change_column "current_segments", "node_b", :bigint, :limit => 64, :null => false
15 change_column "current_segments", "user_id", :bigint, :limit => 20, :null => false
16 change_column "current_segments", "visible", :boolean, :null => false
17 change_column "current_segments", "timestamp", :datetime, :null => false
18 add_primary_key "current_segments", ["id"]
19 remove_index "current_segments", :name => "current_segments_id_visible_idx"
21 change_column "current_way_segments", "id", :bigint, :limit => 64, :null => false
22 change_column "current_way_segments", "segment_id", :bigint, :limit => 64, :null => false
23 change_column "current_way_segments", "sequence_id", :bigint, :limit => 11, :null => false
24 add_primary_key "current_way_segments", ["id", "sequence_id"]
25 remove_index "current_way_segments", :name => "current_way_segments_id_idx"
27 change_column "current_way_tags", "id", :bigint, :limit => 64, :null => false
29 change_column "current_ways", "user_id", :bigint, :limit => 20, :null => false
30 change_column "current_ways", "timestamp", :datetime, :null => false
31 change_column "current_ways", "visible", :boolean, :null => false
32 execute "ALTER TABLE current_ways ENGINE = InnoDB"
34 change_column "diary_entries", "title", :string, :null => false
35 change_column "diary_entries", "body", :text, :null => false
36 change_column "diary_entries", "created_at", :datetime, :null => false
37 change_column "diary_entries", "updated_at", :datetime, :null => false
39 add_index "friends", ["user_id"], :name => "friends_user_id_idx"
41 remove_index "gps_points", :name => "points_uid_idx"
42 remove_column "gps_points", "user_id"
43 change_column "gps_points", "trackid", :integer, :null => false
44 change_column "gps_points", "latitude", :integer, :null => false
45 change_column "gps_points", "longitude", :integer, :null => false
46 change_column "gps_points", "gpx_id", :bigint, :limit => 64, :null => false
48 change_column "gpx_file_tags", "tag", :string, :null => false
50 change_column "gpx_files", "user_id", :bigint, :limit => 20, :null => false
51 change_column "gpx_files", "timestamp", :datetime, :null => false
52 change_column "gpx_files", "description", :string, :default => "", :null => false
53 change_column "gpx_files", "inserted", :boolean, :null => false
55 drop_table "gpx_pending_files"
57 remove_index "messages", :name => "from_name_idx"
58 remove_column "messages", "user_id"
59 remove_column "messages", "from_display_name"
60 change_column "messages", "title", :string, :null => false
61 change_column "messages", "body", :text, :null => false
62 change_column "messages", "sent_on", :datetime, :null => false
63 change_column "messages", "message_read", :boolean, :default => false, :null => false
64 add_index "messages", ["to_user_id"], :name => "messages_to_user_id_idx"
66 drop_table "meta_areas"
68 change_column "nodes", "id", :bigint, :limit => 64, :null => false
69 change_column "nodes", "latitude", :double, :null => false
70 change_column "nodes", "longitude", :double, :null => false
71 change_column "nodes", "user_id", :bigint, :limit => 20, :null => false
72 change_column "nodes", "visible", :boolean, :null => false
73 change_column "nodes", "timestamp", :datetime, :null => false
74 add_index "nodes", ["timestamp"], :name => "nodes_timestamp_idx"
76 change_column "segments", "id", :bigint, :limit => 64, :null => false
77 change_column "segments", "node_a", :bigint, :limit => 64, :null => false
78 change_column "segments", "node_b", :bigint, :limit => 64, :null => false
79 change_column "segments", "user_id", :bigint, :limit => 20, :null => false
80 change_column "segments", "visible", :boolean, :null => false
81 change_column "segments", "timestamp", :datetime, :null => false
82 add_index "segments", ["timestamp"], :name => "segments_timestamp_idx"
84 remove_column "users", "preferences"
85 change_column "users", "email", :string, :null => false
86 change_column "users", "pass_crypt", :string, :null => false
87 change_column "users", "creation_time", :datetime, :null => false
88 change_column "users", "display_name", :string, :default => "", :null => false
89 change_column "users", "data_public", :boolean, :default => false, :null => false
90 change_column "users", "home_lat", :double
91 change_column "users", "home_lon", :double
92 remove_index "users", :name => "users_email_idx"
93 add_index "users", ["email"], :name => "users_email_idx", :unique => true
94 remove_index "users", :name => "users_display_name_idx"
95 add_index "users", ["display_name"], :name => "users_display_name_idx", :unique => true
97 change_column "way_segments", "segment_id", :bigint, :limit => 64, :null => false
99 change_column "way_tags", "k", :string, :null => false
100 change_column "way_tags", "v", :string, :null => false
101 change_column "way_tags", "version", :bigint, :limit => 20, :null => false
103 change_column "ways", "user_id", :bigint, :limit => 20, :null => false
104 change_column "ways", "timestamp", :datetime, :null => false
105 change_column "ways", "visible", :boolean, :default => true, :null => false
106 remove_index "ways", :name => "ways_id_version_idx"
107 add_index "ways", ["timestamp"], :name => "ways_timestamp_idx"
111 remove_index "ways", :name => "ways_timestamp_idx"
112 add_index "ways", ["id"], :name => "ways_id_version_idx"
113 change_column "ways", "visible", :boolean, :default => true
114 change_column "ways", "timestamp", :datetime
115 change_column "ways", "user_id", :bigint, :limit => 20
117 change_column "way_tags", "version", :bigint, :limit => 20
118 change_column "way_tags", "v", :string, :default => nil
119 change_column "way_tags", "k", :string, :default => nil
121 change_column "way_segments", "segment_id", :integer
123 remove_index "users", :name => "users_display_name_idx"
124 add_index "users", ["display_name"], :name => "users_display_name_idx"
125 remove_index "users", :name => "users_email_idx"
126 add_index "users", ["email"], :name => "users_email_idx"
127 change_column "users", "home_lon", :double, :default => 1
128 change_column "users", "home_lat", :double, :default => 1
129 change_column "users", "data_public", :boolean, :default => false
130 change_column "users", "display_name", :string, :default => ""
131 change_column "users", "creation_time", :datetime
132 change_column "users", "pass_crypt", :string, :default => nil
133 change_column "users", "email", :string, :default => nil
134 add_column "users", "preferences", :text
136 remove_index "segments", :name => "segments_timestamp_idx"
137 change_column "segments", "timestamp", :datetime
138 change_column "segments", "visible", :boolean
139 change_column "segments", "user_id", :bigint, :limit => 20
140 change_column "segments", "node_b", :bigint, :limit => 64
141 change_column "segments", "node_a", :bigint, :limit => 64
142 change_column "segments", "id", :bigint, :limit => 64
144 remove_index "nodes", :name => "nodes_timestamp_idx"
145 change_column "nodes", "timestamp", :datetime
146 change_column "nodes", "visible", :boolean
147 change_column "nodes", "user_id", :bigint, :limit => 20
148 change_column "nodes", "longitude", :double
149 change_column "nodes", "latitude", :double
150 change_column "nodes", "id", :bigint, :limit => 64
152 create_table "meta_areas", myisam_table do |t|
153 t.column "id", :bigint, :limit => 64, :null => false
154 t.column "user_id", :bigint, :limit => 20
155 t.column "timestamp", :datetime
158 add_primary_key "meta_areas", ["id"]
160 change_column "meta_areas", "id", :bigint, :limit => 64, :null => false, :options => "AUTO_INCREMENT"
162 remove_index "messages", :name => "messages_to_user_id_idx"
163 change_column "messages", "message_read", :boolean, :default => false
164 change_column "messages", "sent_on", :datetime
165 change_column "messages", "body", :text
166 change_column "messages", "title", :string, :default => nil
167 add_column "messages", "from_display_name", :string, :default => ""
168 add_column "messages", "user_id", :bigint, :limit => 20, :null => false
169 add_index "messages", ["from_display_name"], :name => "from_name_idx"
171 create_table "gpx_pending_files", myisam_table do |t|
172 t.column "originalname", :string
173 t.column "tmpname", :string
174 t.column "user_id", :bigint, :limit => 20
177 change_column "gpx_files", "inserted", :boolean
178 change_column "gpx_files", "description", :string, :default => ""
179 change_column "gpx_files", "timestamp", :datetime
180 change_column "gpx_files", "user_id", :bigint, :limit => 20
182 change_column "gpx_file_tags", "tag", :string, :default => nil
184 change_column "gps_points", "gpx_id", :integer, :limit => 20
185 change_column "gps_points", "longitude", :integer
186 change_column "gps_points", "latitude", :integer
187 change_column "gps_points", "trackid", :integer
188 add_column "gps_points", "user_id", :integer, :limit => 20
189 add_index "gps_points", ["user_id"], :name => "points_uid_idx"
191 remove_index "friends", :name => "friends_user_id_idx"
193 change_column "diary_entries", "updated_at", :datetime
194 change_column "diary_entries", "created_at", :datetime
195 change_column "diary_entries", "body", :text
196 change_column "diary_entries", "title", :string, :default => nil
198 execute "ALTER TABLE current_ways ENGINE = MyISAM"
199 change_column "current_ways", "visible", :boolean
200 change_column "current_ways", "timestamp", :datetime
201 change_column "current_ways", "user_id", :bigint, :limit => 20
203 change_column "current_way_tags", "id", :bigint, :limit => 64
205 add_index "current_way_segments", ["id"], :name => "current_way_segments_id_idx"
206 remove_primary_key "current_way_segments"
207 change_column "current_way_segments", "sequence_id", :bigint, :limit => 11
208 change_column "current_way_segments", "segment_id", :bigint, :limit => 11
209 change_column "current_way_segments", "id", :bigint, :limit => 64
211 add_index "current_segments", ["id", "visible"], :name => "current_segments_id_visible_idx"
212 remove_primary_key "current_segments"
213 change_column "current_segments", "timestamp", :datetime
214 change_column "current_segments", "visible", :boolean
215 change_column "current_segments", "user_id", :bigint, :limit => 20
216 change_column "current_segments", "node_b", :bigint, :limit => 64
217 change_column "current_segments", "node_a", :bigint, :limit => 64
219 add_index "current_nodes", ["id"], :name => "current_nodes_id_idx"
220 remove_primary_key "current_nodes"
221 change_column "current_nodes", "timestamp", :datetime
222 change_column "current_nodes", "visible", :boolean
223 change_column "current_nodes", "user_id", :bigint, :limit => 20
224 change_column "current_nodes", "longitude", :double
225 change_column "current_nodes", "latitude", :double
226 change_column "current_nodes", "id", :bigint, :limit => 64, :null => false, :options => "AUTO_INCREMENT"