3 class CreateOsmDb < ActiveRecord::Migration
5 create_table "current_nodes", :id => false do |t|
6 t.column "id", :bigint, :null => false
7 t.column "latitude", :float, :limit => 53
8 t.column "longitude", :float, :limit => 53
9 t.column "user_id", :bigint
10 t.column "visible", :boolean
11 t.column "tags", :text, :default => "", :null => false
12 t.column "timestamp", :datetime
15 add_index "current_nodes", ["id"], :name => "current_nodes_id_idx"
16 add_index "current_nodes", %w[latitude longitude], :name => "current_nodes_lat_lon_idx"
17 add_index "current_nodes", ["timestamp"], :name => "current_nodes_timestamp_idx"
19 create_table "current_segments", :id => false do |t|
20 t.column "id", :bigint, :null => false
21 t.column "node_a", :bigint
22 t.column "node_b", :bigint
23 t.column "user_id", :bigint
24 t.column "visible", :boolean
25 t.column "tags", :text, :default => "", :null => false
26 t.column "timestamp", :datetime
29 add_index "current_segments", %w[id visible], :name => "current_segments_id_visible_idx"
30 add_index "current_segments", ["node_a"], :name => "current_segments_a_idx"
31 add_index "current_segments", ["node_b"], :name => "current_segments_b_idx"
33 create_table "current_way_segments", :id => false do |t|
34 t.column "id", :bigint
35 t.column "segment_id", :bigint
36 t.column "sequence_id", :bigint
39 add_index "current_way_segments", ["segment_id"], :name => "current_way_segments_seg_idx"
40 add_index "current_way_segments", ["id"], :name => "current_way_segments_id_idx"
42 create_table "current_way_tags", :id => false do |t|
43 t.column "id", :bigint
44 t.column "k", :string, :default => "", :null => false
45 t.column "v", :string, :default => "", :null => false
48 add_index "current_way_tags", ["id"], :name => "current_way_tags_id_idx"
49 add_index "current_way_tags", "v", :name => "current_way_tags_v_idx"
51 create_table "current_ways", :id => false do |t|
52 t.column "id", :bigserial, :primary_key => true, :null => false
53 t.column "user_id", :bigint
54 t.column "timestamp", :datetime
55 t.column "visible", :boolean
58 create_table "diary_entries", :id => false do |t|
59 t.column "id", :bigserial, :primary_key => true, :null => false
60 t.column "user_id", :bigint, :null => false
61 t.column "title", :string
62 t.column "body", :text
63 t.column "created_at", :datetime
64 t.column "updated_at", :datetime
67 create_table "friends", :id => false do |t|
68 t.column "id", :bigserial, :primary_key => true, :null => false
69 t.column "user_id", :bigint, :null => false
70 t.column "friend_user_id", :bigint, :null => false
73 add_index "friends", ["friend_user_id"], :name => "user_id_idx"
75 create_table "gps_points", :id => false do |t|
76 t.column "altitude", :float
77 t.column "user_id", :integer
78 t.column "trackid", :integer
79 t.column "latitude", :integer
80 t.column "longitude", :integer
81 t.column "gpx_id", :integer
82 t.column "timestamp", :datetime
85 add_index "gps_points", %w[latitude longitude user_id], :name => "points_idx"
86 add_index "gps_points", ["user_id"], :name => "points_uid_idx"
87 add_index "gps_points", ["gpx_id"], :name => "points_gpxid_idx"
89 create_table "gpx_file_tags", :id => false do |t|
90 t.column "gpx_id", :bigint, :default => 0, :null => false
91 t.column "tag", :string
92 t.column "id", :bigserial, :primary_key => true, :null => false
95 add_index "gpx_file_tags", ["gpx_id"], :name => "gpx_file_tags_gpxid_idx"
97 create_table "gpx_files", :id => false do |t|
98 t.column "id", :bigserial, :primary_key => true, :null => false
99 t.column "user_id", :bigint
100 t.column "visible", :boolean, :default => true, :null => false
101 t.column "name", :string, :default => "", :null => false
102 t.column "size", :bigint
103 t.column "latitude", :float, :limit => 53
104 t.column "longitude", :float, :limit => 53
105 t.column "timestamp", :datetime
106 t.column "public", :boolean, :default => true, :null => false
107 t.column "description", :string, :default => ""
108 t.column "inserted", :boolean
111 add_index "gpx_files", ["timestamp"], :name => "gpx_files_timestamp_idx"
112 add_index "gpx_files", %w[visible public], :name => "gpx_files_visible_public_idx"
114 create_table "gpx_pending_files", :id => false do |t|
115 t.column "originalname", :string
116 t.column "tmpname", :string
117 t.column "user_id", :bigint
120 create_table "messages", :id => false do |t|
121 t.column "id", :bigserial, :primary_key => true, :null => false
122 t.column "user_id", :bigint, :null => false
123 t.column "from_user_id", :bigint, :null => false
124 t.column "from_display_name", :string, :default => ""
125 t.column "title", :string
126 t.column "body", :text
127 t.column "sent_on", :datetime
128 t.column "message_read", :boolean, :default => false
129 t.column "to_user_id", :bigint, :null => false
132 add_index "messages", ["from_display_name"], :name => "from_name_idx"
134 create_table "meta_areas", :id => false do |t|
135 t.column "id", :bigserial, :primary_key => true, :null => false
136 t.column "user_id", :bigint
137 t.column "timestamp", :datetime
140 create_table "nodes", :id => false do |t|
141 t.column "id", :bigint
142 t.column "latitude", :float, :limit => 53
143 t.column "longitude", :float, :limit => 53
144 t.column "user_id", :bigint
145 t.column "visible", :boolean
146 t.column "tags", :text, :default => "", :null => false
147 t.column "timestamp", :datetime
150 add_index "nodes", ["id"], :name => "nodes_uid_idx"
151 add_index "nodes", %w[latitude longitude], :name => "nodes_latlon_idx"
153 create_table "segments", :id => false do |t|
154 t.column "id", :bigint
155 t.column "node_a", :bigint
156 t.column "node_b", :bigint
157 t.column "user_id", :bigint
158 t.column "visible", :boolean
159 t.column "tags", :text, :default => "", :null => false
160 t.column "timestamp", :datetime
163 add_index "segments", ["node_a"], :name => "street_segments_nodea_idx"
164 add_index "segments", ["node_b"], :name => "street_segments_nodeb_idx"
165 add_index "segments", ["id"], :name => "street_segment_uid_idx"
167 create_table "users", :id => false do |t|
168 t.column "email", :string
169 t.column "id", :bigserial, :primary_key => true, :null => false
170 t.column "token", :string
171 t.column "active", :integer, :default => 0, :null => false
172 t.column "pass_crypt", :string
173 t.column "creation_time", :datetime
174 t.column "timeout", :datetime
175 t.column "display_name", :string, :default => ""
176 t.column "preferences", :text
177 t.column "data_public", :boolean, :default => false
178 t.column "description", :text, :default => "", :null => false
179 t.column "home_lat", :float, :limit => 53, :default => 1
180 t.column "home_lon", :float, :limit => 53, :default => 1
181 t.column "within_lon", :float, :limit => 53
182 t.column "within_lat", :float, :limit => 53
183 t.column "home_zoom", :integer, :limit => 2, :default => 3
186 add_index "users", ["email"], :name => "users_email_idx"
187 add_index "users", ["display_name"], :name => "users_display_name_idx"
189 create_table "way_segments", :id => false do |t|
190 t.column "id", :bigint, :default => 0, :null => false
191 t.column "segment_id", :integer
192 t.column "version", :bigint, :default => 0, :null => false
193 t.column "sequence_id", :bigint, :null => false
196 add_primary_key "way_segments", %w[id version sequence_id]
198 create_table "way_tags", :id => false do |t|
199 t.column "id", :bigint, :default => 0, :null => false
200 t.column "k", :string
201 t.column "v", :string
202 t.column "version", :bigint
205 add_index "way_tags", %w[id version], :name => "way_tags_id_version_idx"
207 create_table "ways", :id => false do |t|
208 t.column "id", :bigint, :default => 0, :null => false
209 t.column "user_id", :bigint
210 t.column "timestamp", :datetime
211 t.column "version", :bigint, :null => false
212 t.column "visible", :boolean, :default => true
215 add_primary_key "ways", %w[id version]
216 add_index "ways", ["id"], :name => "ways_id_version_idx"