1 class CleanupOsmDb < ActiveRecord::Migration[4.2]
3 change_column "current_nodes", "latitude", :float, :limit => 53, :null => false
4 change_column "current_nodes", "longitude", :float, :limit => 53, :null => false
5 change_column "current_nodes", "user_id", :bigint, :null => false
6 change_column "current_nodes", "visible", :boolean, :null => false
7 change_column "current_nodes", "timestamp", :datetime, :null => false
8 add_primary_key "current_nodes", ["id"]
9 remove_index "current_nodes", :name => "current_nodes_id_idx"
11 change_column "current_segments", "node_a", :bigint, :null => false
12 change_column "current_segments", "node_b", :bigint, :null => false
13 change_column "current_segments", "user_id", :bigint, :null => false
14 change_column "current_segments", "visible", :boolean, :null => false
15 change_column "current_segments", "timestamp", :datetime, :null => false
16 add_primary_key "current_segments", ["id"]
17 remove_index "current_segments", :name => "current_segments_id_visible_idx"
19 change_column "current_way_segments", "id", :bigint, :null => false
20 change_column "current_way_segments", "segment_id", :bigint, :null => false
21 change_column "current_way_segments", "sequence_id", :bigint, :null => false
22 add_primary_key "current_way_segments", %w[id sequence_id]
23 remove_index "current_way_segments", :name => "current_way_segments_id_idx"
25 change_column "current_way_tags", "id", :bigint, :null => false
27 change_column "current_ways", "user_id", :bigint, :null => false
28 change_column "current_ways", "timestamp", :datetime, :null => false
29 change_column "current_ways", "visible", :boolean, :null => false
31 change_column "diary_entries", "title", :string, :null => false
32 change_column "diary_entries", "body", :text, :null => false
33 change_column "diary_entries", "created_at", :datetime, :null => false
34 change_column "diary_entries", "updated_at", :datetime, :null => false
36 add_index "friends", ["user_id"], :name => "friends_user_id_idx"
38 remove_index "gps_points", :name => "points_uid_idx"
39 remove_index "gps_points", :name => "points_idx"
40 remove_column "gps_points", "user_id"
41 add_index "gps_points", %w[latitude longitude], :name => "points_idx"
42 change_column "gps_points", "trackid", :integer, :null => false
43 change_column "gps_points", "latitude", :integer, :null => false
44 change_column "gps_points", "longitude", :integer, :null => false
45 change_column "gps_points", "gpx_id", :bigint, :null => false
47 change_column "gpx_file_tags", "tag", :string, :null => false
49 change_column "gpx_files", "user_id", :bigint, :null => false
50 change_column "gpx_files", "timestamp", :datetime, :null => false
51 change_column "gpx_files", "description", :string, :default => "", :null => false
52 change_column "gpx_files", "inserted", :boolean, :null => false
54 drop_table "gpx_pending_files"
56 remove_index "messages", :name => "from_name_idx"
57 remove_column "messages", "user_id"
58 remove_column "messages", "from_display_name"
59 change_column "messages", "title", :string, :null => false
60 change_column "messages", "body", :text, :null => false
61 change_column "messages", "sent_on", :datetime, :null => false
62 change_column "messages", "message_read", :boolean, :default => false, :null => false
63 add_index "messages", ["to_user_id"], :name => "messages_to_user_id_idx"
65 drop_table "meta_areas"
67 change_column "nodes", "id", :bigint, :null => false
68 change_column "nodes", "latitude", :float, :limit => 53, :null => false
69 change_column "nodes", "longitude", :float, :limit => 53, :null => false
70 change_column "nodes", "user_id", :bigint, :null => false
71 change_column "nodes", "visible", :boolean, :null => false
72 change_column "nodes", "timestamp", :datetime, :null => false
73 add_index "nodes", ["timestamp"], :name => "nodes_timestamp_idx"
75 change_column "segments", "id", :bigint, :null => false
76 change_column "segments", "node_a", :bigint, :null => false
77 change_column "segments", "node_b", :bigint, :null => false
78 change_column "segments", "user_id", :bigint, :null => false
79 change_column "segments", "visible", :boolean, :null => false
80 change_column "segments", "timestamp", :datetime, :null => false
81 add_index "segments", ["timestamp"], :name => "segments_timestamp_idx"
83 remove_column "users", "preferences"
84 change_column "users", "email", :string, :null => false
85 change_column "users", "pass_crypt", :string, :null => false
86 change_column "users", "creation_time", :datetime, :null => false
87 change_column "users", "display_name", :string, :default => "", :null => false
88 change_column "users", "data_public", :boolean, :default => false, :null => false
89 change_column "users", "home_lat", :float, :limit => 53, :default => nil
90 change_column "users", "home_lon", :float, :limit => 53, :default => nil
91 remove_index "users", :name => "users_email_idx"
92 add_index "users", ["email"], :name => "users_email_idx", :unique => true
93 remove_index "users", :name => "users_display_name_idx"
94 add_index "users", ["display_name"], :name => "users_display_name_idx", :unique => true
96 change_column "way_segments", "segment_id", :bigint, :null => false
98 change_column "way_tags", "k", :string, :null => false
99 change_column "way_tags", "v", :string, :null => false
100 change_column "way_tags", "version", :bigint, :null => false
102 change_column "ways", "user_id", :bigint, :null => false
103 change_column "ways", "timestamp", :datetime, :null => false
104 change_column "ways", "visible", :boolean, :default => true, :null => false
105 remove_index "ways", :name => "ways_id_version_idx"
106 add_index "ways", ["timestamp"], :name => "ways_timestamp_idx"
110 remove_index "ways", :name => "ways_timestamp_idx"
111 add_index "ways", ["id"], :name => "ways_id_version_idx"
112 change_column "ways", "visible", :boolean, :default => true
113 change_column "ways", "timestamp", :datetime
114 change_column "ways", "user_id", :bigint
116 change_column "way_tags", "version", :bigint
117 change_column "way_tags", "v", :string, :default => nil
118 change_column "way_tags", "k", :string, :default => nil
120 change_column "way_segments", "segment_id", :integer
122 remove_index "users", :name => "users_display_name_idx"
123 add_index "users", ["display_name"], :name => "users_display_name_idx"
124 remove_index "users", :name => "users_email_idx"
125 add_index "users", ["email"], :name => "users_email_idx"
126 change_column "users", "home_lon", :float, :limit => 53, :default => 1
127 change_column "users", "home_lat", :float, :limit => 53, :default => 1
128 change_column "users", "data_public", :boolean, :default => false
129 change_column "users", "display_name", :string, :default => ""
130 change_column "users", "creation_time", :datetime
131 change_column "users", "pass_crypt", :string, :default => nil
132 change_column "users", "email", :string, :default => nil
133 add_column "users", "preferences", :text
135 remove_index "segments", :name => "segments_timestamp_idx"
136 change_column "segments", "timestamp", :datetime
137 change_column "segments", "visible", :boolean
138 change_column "segments", "user_id", :bigint
139 change_column "segments", "node_b", :bigint
140 change_column "segments", "node_a", :bigint
141 change_column "segments", "id", :bigint
143 remove_index "nodes", :name => "nodes_timestamp_idx"
144 change_column "nodes", "timestamp", :datetime
145 change_column "nodes", "visible", :boolean
146 change_column "nodes", "user_id", :bigint
147 change_column "nodes", "longitude", :float, :limit => 53
148 change_column "nodes", "latitude", :float, :limit => 53
149 change_column "nodes", "id", :bigint
151 create_table "meta_areas", :id => false do |t|
152 t.column "id", :bigserial, :primary_key => true, :null => false
153 t.column "user_id", :bigint
154 t.column "timestamp", :datetime
157 remove_index "messages", :name => "messages_to_user_id_idx"
158 change_column "messages", "message_read", :boolean, :default => false
159 change_column "messages", "sent_on", :datetime
160 change_column "messages", "body", :text
161 change_column "messages", "title", :string, :default => nil
162 add_column "messages", "from_display_name", :string, :default => ""
163 add_column "messages", "user_id", :bigint, :null => false
164 add_index "messages", ["from_display_name"], :name => "from_name_idx"
166 create_table "gpx_pending_files", :id => false do |t|
167 t.column "originalname", :string
168 t.column "tmpname", :string
169 t.column "user_id", :bigint
172 change_column "gpx_files", "inserted", :boolean
173 change_column "gpx_files", "description", :string, :default => ""
174 change_column "gpx_files", "timestamp", :datetime
175 change_column "gpx_files", "user_id", :bigint
177 change_column "gpx_file_tags", "tag", :string, :default => nil
179 change_column "gps_points", "gpx_id", :integer
180 change_column "gps_points", "longitude", :integer
181 change_column "gps_points", "latitude", :integer
182 change_column "gps_points", "trackid", :integer
183 add_column "gps_points", "user_id", :integer
184 add_index "gps_points", ["user_id"], :name => "points_uid_idx"
186 remove_index "friends", :name => "friends_user_id_idx"
188 change_column "diary_entries", "updated_at", :datetime
189 change_column "diary_entries", "created_at", :datetime
190 change_column "diary_entries", "body", :text
191 change_column "diary_entries", "title", :string, :default => nil
193 change_column "current_ways", "visible", :boolean
194 change_column "current_ways", "timestamp", :datetime
195 change_column "current_ways", "user_id", :bigint
197 change_column "current_way_tags", "id", :bigint
199 add_index "current_way_segments", ["id"], :name => "current_way_segments_id_idx"
200 remove_primary_key "current_way_segments"
201 change_column "current_way_segments", "sequence_id", :bigint
202 change_column "current_way_segments", "segment_id", :bigint
203 change_column "current_way_segments", "id", :bigint
205 add_index "current_segments", %w[id visible], :name => "current_segments_id_visible_idx"
206 remove_primary_key "current_segments"
207 change_column "current_segments", "timestamp", :datetime
208 change_column "current_segments", "visible", :boolean
209 change_column "current_segments", "user_id", :bigint
210 change_column "current_segments", "node_b", :bigint
211 change_column "current_segments", "node_a", :bigint
213 add_index "current_nodes", ["id"], :name => "current_nodes_id_idx"
214 remove_primary_key "current_nodes"
215 change_column "current_nodes", "timestamp", :datetime
216 change_column "current_nodes", "visible", :boolean
217 change_column "current_nodes", "user_id", :bigint
218 change_column "current_nodes", "longitude", :float, :limit => 53
219 change_column "current_nodes", "latitude", :float, :limit => 53