ninoxe 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +49 -0
- data/app/assets/javascripts/ninoxe/application.js +15 -0
- data/app/assets/stylesheets/ninoxe/application.css +13 -0
- data/app/controllers/ninoxe/application_controller.rb +4 -0
- data/app/helpers/ninoxe/application_helper.rb +4 -0
- data/app/models/chouette/access_link.rb +63 -0
- data/app/models/chouette/access_point.rb +145 -0
- data/app/models/chouette/access_point_type.rb +50 -0
- data/app/models/chouette/active_record.rb +66 -0
- data/app/models/chouette/area_type.rb +56 -0
- data/app/models/chouette/chouette_structure.dump +3417 -0
- data/app/models/chouette/command.rb +93 -0
- data/app/models/chouette/command_line_support.rb +35 -0
- data/app/models/chouette/company.rb +19 -0
- data/app/models/chouette/connection_link.rb +43 -0
- data/app/models/chouette/connection_link_type.rb +51 -0
- data/app/models/chouette/direction.rb +60 -0
- data/app/models/chouette/exporter.rb +32 -0
- data/app/models/chouette/file_validator.rb +47 -0
- data/app/models/chouette/group_of_line.rb +30 -0
- data/app/models/chouette/journey_pattern.rb +63 -0
- data/app/models/chouette/line.rb +65 -0
- data/app/models/chouette/link_orientation_type.rb +49 -0
- data/app/models/chouette/loader.rb +110 -0
- data/app/models/chouette/network.rb +33 -0
- data/app/models/chouette/object_id.rb +36 -0
- data/app/models/chouette/pt_link.rb +39 -0
- data/app/models/chouette/route.rb +158 -0
- data/app/models/chouette/stop_area.rb +273 -0
- data/app/models/chouette/stop_point.rb +33 -0
- data/app/models/chouette/time_table.rb +146 -0
- data/app/models/chouette/time_table_date.rb +14 -0
- data/app/models/chouette/time_table_period.rb +26 -0
- data/app/models/chouette/time_table_vehicle_journey.rb +5 -0
- data/app/models/chouette/transport_mode.rb +71 -0
- data/app/models/chouette/trident_active_record.rb +97 -0
- data/app/models/chouette/vehicle_journey.rb +101 -0
- data/app/models/chouette/vehicle_journey_at_stop.rb +45 -0
- data/app/models/chouette/wayback.rb +50 -0
- data/app/views/layouts/ninoxe/application.html.erb +14 -0
- data/config/database.yml +9 -0
- data/config/database.yml.ci +14 -0
- data/config/database.yml.travis +9 -0
- data/config/locales/en.yml +15 -0
- data/config/locales/fr.yml +16 -0
- data/config/routes.rb +2 -0
- data/db/migrate/20120213131553_create_chouette_line.rb +26 -0
- data/db/migrate/20120214101458_create_chouette_company.rb +25 -0
- data/db/migrate/20120214101645_create_chouette_ptnetwork.rb +24 -0
- data/db/migrate/20120406144221_create_chouette_stop_area.rb +33 -0
- data/db/migrate/20120411144209_create_time_table.rb +38 -0
- data/db/migrate/20120425064403_create_chouette_route.rb +22 -0
- data/db/migrate/20120425123944_create_chouette_stop_point.rb +17 -0
- data/db/migrate/20120426114527_create_chouette_connection_link.rb +28 -0
- data/db/migrate/20120521073709_create_chouette_journey_pattern.rb +26 -0
- data/db/migrate/20120521073723_create_chouette_journey_pattern_stop_point.rb +14 -0
- data/db/migrate/20120521073740_create_chouette_time_slot.rb +22 -0
- data/db/migrate/20120521073746_create_chouette_vehicle_journey.rb +34 -0
- data/db/migrate/20120521073758_create_chouette_vehicle_journey_at_stop.rb +25 -0
- data/db/migrate/20120521073900_create_chouette_time_table_vehicle_journey.rb +16 -0
- data/db/migrate/20120521132304_create_chouette_access_point.rb +34 -0
- data/db/migrate/20120521132313_create_chouette_access_link.rb +33 -0
- data/db/migrate/20120521132429_create_chouette_facility.rb +34 -0
- data/db/migrate/20120521132502_create_chouette_facility_feature.rb +12 -0
- data/db/migrate/20120521132551_create_chouette_group_of_line.rb +18 -0
- data/db/migrate/20120521132600_create_chouette_group_of_line_line.rb +12 -0
- data/db/migrate/20120521132656_create_chouette_routing_constrains_line.rb +12 -0
- data/db/migrate/20120521132724_create_chouette_stoparea_stoparea.rb +12 -0
- data/db/migrate/20120531091529_create_chouette_pt_link.rb +21 -0
- data/db/migrate/20120926141405_add_id_to_time_table_date.rb +12 -0
- data/db/migrate/20120926141415_add_id_to_time_table_period.rb +12 -0
- data/db/migrate/20121024072219_add_fields_to_access_points.rb +12 -0
- data/lib/chouette_factories.rb +1 -0
- data/lib/factories/chouette_access_links.rb +11 -0
- data/lib/factories/chouette_access_points.rb +8 -0
- data/lib/factories/chouette_companies.rb +5 -0
- data/lib/factories/chouette_connection_links.rb +11 -0
- data/lib/factories/chouette_group_of_lines.rb +4 -0
- data/lib/factories/chouette_journey_pattern.rb +32 -0
- data/lib/factories/chouette_lines.rb +20 -0
- data/lib/factories/chouette_networks.rb +5 -0
- data/lib/factories/chouette_routes.rb +18 -0
- data/lib/factories/chouette_stop_areas.rb +8 -0
- data/lib/factories/chouette_stop_points.rb +7 -0
- data/lib/factories/chouette_time_table.rb +21 -0
- data/lib/factories/chouette_vehicle_journey.rb +50 -0
- data/lib/factories/chouette_vehicle_journey_at_stop.rb +5 -0
- data/lib/ninoxe/engine.rb +15 -0
- data/lib/ninoxe/version.rb +3 -0
- data/lib/ninoxe.rb +7 -0
- metadata +251 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
class CreateChouetteCompany < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table "companies", :force => true do |t|
|
4
|
+
t.string "objectid", :null => false
|
5
|
+
t.integer "object_version"
|
6
|
+
t.datetime "creation_time"
|
7
|
+
t.string "creator_id"
|
8
|
+
t.string "name"
|
9
|
+
t.string "short_name"
|
10
|
+
t.string "organizational_unit"
|
11
|
+
t.string "operating_department_name"
|
12
|
+
t.string "code"
|
13
|
+
t.string "phone"
|
14
|
+
t.string "fax"
|
15
|
+
t.string "email"
|
16
|
+
t.string "registration_number"
|
17
|
+
end
|
18
|
+
|
19
|
+
add_index "companies", ["objectid"], :name => "companies_objectid_key", :unique => true
|
20
|
+
add_index "companies", ["registration_number"], :name => "companies_registration_number_key", :unique => true
|
21
|
+
end
|
22
|
+
|
23
|
+
def down
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class CreateChouettePtnetwork < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table "networks", :force => true do |t|
|
4
|
+
t.string "objectid", :null => false
|
5
|
+
t.integer "object_version"
|
6
|
+
t.datetime "creation_time"
|
7
|
+
t.string "creator_id"
|
8
|
+
t.date "version_date"
|
9
|
+
t.string "description"
|
10
|
+
t.string "name"
|
11
|
+
t.string "registration_number"
|
12
|
+
t.string "source_name"
|
13
|
+
t.string "source_type"
|
14
|
+
t.string "source_identifier"
|
15
|
+
t.string "comment"
|
16
|
+
end
|
17
|
+
|
18
|
+
add_index "networks", ["objectid"], :name => "networks_objectid_key", :unique => true
|
19
|
+
add_index "networks", ["registration_number"], :name => "networks_registration_number_key", :unique => true
|
20
|
+
end
|
21
|
+
|
22
|
+
def down
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
class CreateChouetteStopArea < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table "stop_areas", :force => true do |t|
|
4
|
+
t.integer "parent_id", :limit => 8
|
5
|
+
t.string "objectid", :null => false
|
6
|
+
t.integer "object_version"
|
7
|
+
t.datetime "creation_time"
|
8
|
+
t.string "creator_id"
|
9
|
+
t.string "name"
|
10
|
+
t.string "comment"
|
11
|
+
t.string "area_type"
|
12
|
+
t.string "registration_number"
|
13
|
+
t.string "nearest_topic_name"
|
14
|
+
t.integer "fare_code"
|
15
|
+
t.decimal "longitude", :precision => 19, :scale => 16
|
16
|
+
t.decimal "latitude", :precision => 19, :scale => 16
|
17
|
+
t.string "long_lat_type"
|
18
|
+
t.decimal "x", :precision => 19, :scale => 2
|
19
|
+
t.decimal "y", :precision => 19, :scale => 2
|
20
|
+
t.string "projection_type"
|
21
|
+
t.string "country_code"
|
22
|
+
t.string "street_name"
|
23
|
+
end
|
24
|
+
|
25
|
+
add_index "stop_areas", ["objectid"], :name => "stop_areas_objectid_key", :unique => true
|
26
|
+
add_index "stop_areas", ["parent_id"], :name => "index_stop_areas_on_parent_id"
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
def down
|
31
|
+
drop_table "stop_areas"
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
class CreateTimeTable < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table "time_tables", :force => true do |t|
|
4
|
+
t.string "objectid", :null => false
|
5
|
+
t.integer "object_version", :default => 1
|
6
|
+
t.datetime "creation_time"
|
7
|
+
t.string "creator_id"
|
8
|
+
t.string "version"
|
9
|
+
t.string "comment"
|
10
|
+
t.integer "int_day_types", :default => 0
|
11
|
+
end
|
12
|
+
|
13
|
+
add_index "time_tables", ["objectid"], :name => "time_tables_objectid_key", :unique => true
|
14
|
+
|
15
|
+
create_table "time_table_dates", :id => false, :force => true do |t|
|
16
|
+
t.integer "time_table_id", :limit => 8, :null => false
|
17
|
+
t.date "date"
|
18
|
+
t.integer "position", :null => false
|
19
|
+
end
|
20
|
+
|
21
|
+
add_index "time_table_dates", ["time_table_id"], :name => "index_time_table_dates_on_time_table_id"
|
22
|
+
|
23
|
+
create_table "time_table_periods", :id => false, :force => true do |t|
|
24
|
+
t.integer "time_table_id", :limit => 8, :null => false
|
25
|
+
t.date "period_start"
|
26
|
+
t.date "period_end"
|
27
|
+
t.integer "position", :null => false
|
28
|
+
end
|
29
|
+
|
30
|
+
add_index "time_table_periods", ["time_table_id"], :name => "index_time_table_periods_on_time_table_id"
|
31
|
+
end
|
32
|
+
|
33
|
+
def down
|
34
|
+
drop_table "time_table_periods"
|
35
|
+
drop_table "time_table_dates"
|
36
|
+
drop_table "time_tables"
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class CreateChouetteRoute < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table "routes", :force => true do |t|
|
4
|
+
t.integer "line_id", :limit => 8
|
5
|
+
t.string "objectid", :null => false
|
6
|
+
t.integer "object_version"
|
7
|
+
t.datetime "creation_time"
|
8
|
+
t.string "creator_id"
|
9
|
+
t.string "name"
|
10
|
+
t.string "comment"
|
11
|
+
t.integer "opposite_route_id", :limit => 8
|
12
|
+
t.string "published_name"
|
13
|
+
t.string "number"
|
14
|
+
t.string "direction"
|
15
|
+
t.string "wayback"
|
16
|
+
end
|
17
|
+
add_index "routes", ["objectid"], :name => "routes_objectid_key", :unique => true
|
18
|
+
end
|
19
|
+
|
20
|
+
def down
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateChouetteStopPoint < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table "stop_points", :force => true do |t|
|
4
|
+
t.integer "route_id", :limit => 8
|
5
|
+
t.integer "stop_area_id", :limit => 8
|
6
|
+
t.string "objectid", :null => false
|
7
|
+
t.integer "object_version"
|
8
|
+
t.datetime "creation_time"
|
9
|
+
t.string "creator_id"
|
10
|
+
t.integer "position"
|
11
|
+
end
|
12
|
+
add_index "stop_points", ["objectid"], :name => "stop_points_objectid_key", :unique => true
|
13
|
+
end
|
14
|
+
|
15
|
+
def down
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class CreateChouetteConnectionLink < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table "connection_links", :force => true do |t|
|
4
|
+
t.integer "departure_id", :limit => 8
|
5
|
+
t.integer "arrival_id", :limit => 8
|
6
|
+
t.string "objectid", :null => false
|
7
|
+
t.integer "object_version"
|
8
|
+
t.datetime "creation_time"
|
9
|
+
t.string "creator_id"
|
10
|
+
t.string "name"
|
11
|
+
t.string "comment"
|
12
|
+
t.decimal "link_distance", :precision => 19, :scale => 2
|
13
|
+
t.string "link_type"
|
14
|
+
t.time "default_duration"
|
15
|
+
t.time "frequent_traveller_duration"
|
16
|
+
t.time "occasional_traveller_duration"
|
17
|
+
t.time "mobility_restricted_traveller_duration"
|
18
|
+
t.boolean "mobility_restricted_suitability"
|
19
|
+
t.boolean "stairs_availability"
|
20
|
+
t.boolean "lift_availability"
|
21
|
+
t.integer "int_user_needs"
|
22
|
+
end
|
23
|
+
add_index "connection_links", ["objectid"], :name => "connection_links_objectid_key", :unique => true
|
24
|
+
end
|
25
|
+
|
26
|
+
def down
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class CreateChouetteJourneyPattern < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :journey_patterns, :force => true do |t|
|
4
|
+
t.integer "route_id", :limit => 8
|
5
|
+
|
6
|
+
t.string "objectid", :null => false
|
7
|
+
t.integer "object_version"
|
8
|
+
t.datetime "creation_time"
|
9
|
+
t.string "creator_id"
|
10
|
+
|
11
|
+
t.string "name"
|
12
|
+
t.string "comment"
|
13
|
+
t.string "registration_number"
|
14
|
+
t.string "published_name"
|
15
|
+
|
16
|
+
t.integer "departure_stop_point_id", :limit => 8
|
17
|
+
t.integer "arrival_stop_point_id", :limit => 8
|
18
|
+
end
|
19
|
+
add_index "journey_patterns", ["objectid"], :name => "journey_patterns_objectid_key", :unique => true
|
20
|
+
end
|
21
|
+
|
22
|
+
def down
|
23
|
+
remove_index "journey_patterns", :name => "journey_patterns_objectid_key"
|
24
|
+
drop_table :journey_patterns
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateChouetteJourneyPatternStopPoint < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :journey_patterns_stop_points, :id => false, :force => true do |t|
|
4
|
+
t.integer "journey_pattern_id", :limit => 8
|
5
|
+
t.integer "stop_point_id", :limit => 8
|
6
|
+
end
|
7
|
+
add_index "journey_patterns_stop_points", ["journey_pattern_id"], :name => "index_journey_pattern_id_on_journey_patterns_stop_points"
|
8
|
+
end
|
9
|
+
|
10
|
+
def down
|
11
|
+
remove_index "journey_patterns_stop_points", :name => "index_journey_pattern_id_on_journey_patterns_stop_points"
|
12
|
+
drop_table :journey_pattern_stop_points
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class CreateChouetteTimeSlot < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :time_slots, :force => true do |t|
|
4
|
+
t.string "objectid", :null => false
|
5
|
+
t.integer "object_version"
|
6
|
+
t.datetime "creation_time"
|
7
|
+
t.string "creator_id"
|
8
|
+
|
9
|
+
t.string "name"
|
10
|
+
t.time "beginning_slot_time"
|
11
|
+
t.time "end_slot_time"
|
12
|
+
t.time "first_departure_time_in_slot"
|
13
|
+
t.time "last_departure_time_in_slot"
|
14
|
+
end
|
15
|
+
add_index "time_slots", ["objectid"], :name => "time_slots_objectid_key", :unique => true
|
16
|
+
end
|
17
|
+
|
18
|
+
def down
|
19
|
+
remove_index "time_slots", :name => "time_slots_objectid_key"
|
20
|
+
drop_table :time_slots
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
class CreateChouetteVehicleJourney < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :vehicle_journeys, :force => true do |t|
|
4
|
+
t.integer "route_id", :limit => 8
|
5
|
+
t.integer "journey_pattern_id", :limit => 8
|
6
|
+
t.integer "time_slot_id", :limit => 8
|
7
|
+
t.integer "company_id", :limit => 8
|
8
|
+
|
9
|
+
t.string "objectid", :null => false
|
10
|
+
t.integer "object_version"
|
11
|
+
t.datetime "creation_time"
|
12
|
+
t.string "creator_id"
|
13
|
+
|
14
|
+
t.string "comment"
|
15
|
+
t.string "status_value"
|
16
|
+
t.string "transport_mode"
|
17
|
+
t.string "published_journey_name"
|
18
|
+
t.string "published_journey_identifier"
|
19
|
+
t.string "facility"
|
20
|
+
t.string "vehicle_type_identifier"
|
21
|
+
|
22
|
+
# TODO: delete this column that are here just for chouette-command compliance
|
23
|
+
t.integer "number"
|
24
|
+
end
|
25
|
+
add_index "vehicle_journeys", ["objectid"], :name => "vehicle_journeys_objectid_key", :unique => true
|
26
|
+
add_index "vehicle_journeys", ["route_id"], :name => "index_vehicle_journeys_on_route_id"
|
27
|
+
end
|
28
|
+
|
29
|
+
def down
|
30
|
+
remove_index "vehicle_journeys", :name => "vehicle_journeys_objectid_key"
|
31
|
+
remove_index "vehicle_journeys", :name => "index_vehicle_journeys_on_route_id"
|
32
|
+
drop_table :vehicle_journeys
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class CreateChouetteVehicleJourneyAtStop < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :vehicle_journey_at_stops, :force => true do |t|
|
4
|
+
t.integer "vehicle_journey_id", :limit => 8
|
5
|
+
t.integer "stop_point_id", :limit => 8
|
6
|
+
|
7
|
+
t.string "connecting_service_id"
|
8
|
+
t.string "boarding_alighting_possibility"
|
9
|
+
|
10
|
+
t.time "arrival_time"
|
11
|
+
t.time "departure_time"
|
12
|
+
t.time "waiting_time"
|
13
|
+
t.time "elapse_duration"
|
14
|
+
t.time "headway_frequency"
|
15
|
+
end
|
16
|
+
add_index "vehicle_journey_at_stops", ["vehicle_journey_id"], :name => "index_vehicle_journey_at_stops_on_vehicle_journey_id"
|
17
|
+
add_index "vehicle_journey_at_stops", ["stop_point_id"], :name => "index_vehicle_journey_at_stops_on_stop_pointid"
|
18
|
+
end
|
19
|
+
|
20
|
+
def down
|
21
|
+
remove_index "vehicle_journey_at_stops", :name => "index_vehicle_journey_at_stops_on_vehicle_journey_id"
|
22
|
+
remove_index "vehicle_journey_at_stops", :name => "index_vehicle_journey_at_stops_on_stop_point_id"
|
23
|
+
drop_table :vehicle_journey_at_stops
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateChouetteTimeTableVehicleJourney < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :time_tables_vehicle_journeys, :id => false, :force => true do |t|
|
4
|
+
t.integer "time_table_id", :limit => 8
|
5
|
+
t.integer "vehicle_journey_id", :limit => 8
|
6
|
+
end
|
7
|
+
add_index "time_tables_vehicle_journeys", ["time_table_id"], :name => "index_time_tables_vehicle_journeys_on_time_table_id"
|
8
|
+
add_index "time_tables_vehicle_journeys", ["vehicle_journey_id"], :name => "index_time_tables_vehicle_journeys_on_vehicle_journey_id"
|
9
|
+
end
|
10
|
+
|
11
|
+
def down
|
12
|
+
remove_index "time_tables_vehicle_journeys", :name => "index_time_tables_vehicle_journeys_on_time_table_id"
|
13
|
+
remove_index "time_tables_vehicle_journeys", :name => "index_time_tables_vehicle_journeys_on_vehicle_journey_id"
|
14
|
+
drop_table :time_tables_vehicle_journeys
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
class CreateChouetteAccessPoint < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :access_points, :force => true do |t|
|
4
|
+
t.string "objectid"
|
5
|
+
t.integer "object_version"
|
6
|
+
t.datetime "creation_time"
|
7
|
+
t.string "creator_id"
|
8
|
+
|
9
|
+
t.string "name"
|
10
|
+
t.string "comment"
|
11
|
+
t.decimal "longitude", :precision => 19, :scale => 16
|
12
|
+
t.decimal "latitude", :precision => 19, :scale => 16
|
13
|
+
t.string "long_lat_type"
|
14
|
+
t.decimal "x", :precision => 19, :scale => 2
|
15
|
+
t.decimal "y", :precision => 19, :scale => 2
|
16
|
+
t.string "projection_type"
|
17
|
+
t.string "country_code"
|
18
|
+
t.string "street_name"
|
19
|
+
t.string "contained_in"
|
20
|
+
|
21
|
+
t.datetime "openning_time"
|
22
|
+
t.datetime "closing_time"
|
23
|
+
t.string "type"
|
24
|
+
t.boolean "lift_availability"
|
25
|
+
t.datetime "mobility_restricted_suitability"
|
26
|
+
t.datetime "stairs_availability"
|
27
|
+
end
|
28
|
+
add_index "access_points", ["objectid"], :name => "access_points_objectid_key", :unique => true
|
29
|
+
end
|
30
|
+
|
31
|
+
def down
|
32
|
+
drop_table :access_points
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
class CreateChouetteAccessLink < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :access_links, :force => true do |t|
|
4
|
+
t.integer "access_point_id", :limit => 8
|
5
|
+
t.integer "stop_area_id", :limit => 8
|
6
|
+
|
7
|
+
t.string "objectid", :null => false
|
8
|
+
t.integer "object_version"
|
9
|
+
t.datetime "creation_time"
|
10
|
+
t.string "creator_id"
|
11
|
+
|
12
|
+
t.string "name"
|
13
|
+
t.string "comment"
|
14
|
+
t.decimal "link_distance", :precision => 19, :scale => 2
|
15
|
+
t.boolean "lift_availability"
|
16
|
+
t.boolean "mobility_restricted_suitability"
|
17
|
+
t.boolean "stairs_availability"
|
18
|
+
t.time "default_duration"
|
19
|
+
t.time "frequent_traveller_duration"
|
20
|
+
t.time "occasional_traveller_duration"
|
21
|
+
t.time "mobility_restricted_traveller_duration"
|
22
|
+
|
23
|
+
t.string "link_type"
|
24
|
+
t.integer "int_user_needs"
|
25
|
+
t.string "link_orientation"
|
26
|
+
end
|
27
|
+
add_index "access_links", ["objectid"], :name => "access_links_objectid_key", :unique => true
|
28
|
+
end
|
29
|
+
|
30
|
+
def down
|
31
|
+
drop_table :access_links
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
class CreateChouetteFacility < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :facilities, :force => true do |t|
|
4
|
+
t.integer "stop_area_id", :limit => 8
|
5
|
+
t.integer "line_id", :limit => 8
|
6
|
+
t.integer "connection_link_id",:limit => 8
|
7
|
+
t.integer "stop_point_id", :limit => 8
|
8
|
+
|
9
|
+
t.string "objectid", :null => false
|
10
|
+
t.integer "object_version"
|
11
|
+
t.datetime "creation_time"
|
12
|
+
t.string "creator_id"
|
13
|
+
|
14
|
+
t.string "name"
|
15
|
+
t.string "comment"
|
16
|
+
t.string "description"
|
17
|
+
t.boolean "free_access"
|
18
|
+
t.decimal "longitude", :precision => 19, :scale => 16
|
19
|
+
t.decimal "latitude", :precision => 19, :scale => 16
|
20
|
+
t.string "long_lat_type"
|
21
|
+
t.decimal "x", :precision => 19, :scale => 2
|
22
|
+
t.decimal "y", :precision => 19, :scale => 2
|
23
|
+
t.string "projection_type"
|
24
|
+
t.string "country_code"
|
25
|
+
t.string "street_name"
|
26
|
+
t.string "contained_in"
|
27
|
+
end
|
28
|
+
add_index "facilities", ["objectid"], :name => "facilities_objectid_key", :unique => true
|
29
|
+
end
|
30
|
+
|
31
|
+
def down
|
32
|
+
drop_table :facilities
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateChouetteFacilityFeature < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :facilities_features, :id => false, :force => true do |t|
|
4
|
+
t.integer "facility_id", :limit => 8
|
5
|
+
t.integer "choice_code"
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
drop_table :facilities_features
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateChouetteGroupOfLine < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :group_of_lines, :force => true do |t|
|
4
|
+
t.string "objectid", :null => false
|
5
|
+
t.integer "object_version"
|
6
|
+
t.datetime "creation_time"
|
7
|
+
t.string "creator_id"
|
8
|
+
|
9
|
+
t.string "name"
|
10
|
+
t.string "comment"
|
11
|
+
end
|
12
|
+
add_index "group_of_lines", ["objectid"], :name => "group_of_lines_objectid_key", :unique => true
|
13
|
+
end
|
14
|
+
|
15
|
+
def down
|
16
|
+
drop_table :group_of_lines
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateChouetteGroupOfLineLine < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :group_of_lines_lines, :id => false, :force => true do |t|
|
4
|
+
t.integer "group_of_line_id", :limit => 8
|
5
|
+
t.integer "line_id", :limit => 8
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
drop_table :group_of_lines_lines
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateChouetteRoutingConstrainsLine < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :routing_constraints_lines, :id => false, :force => true do |t|
|
4
|
+
t.integer "stop_area_id", :limit => 8
|
5
|
+
t.integer "line_id", :limit => 8
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
drop_table :routing_constraints_lines
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateChouetteStopareaStoparea < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :stop_areas_stop_areas, :id => false, :force => true do |t|
|
4
|
+
t.integer "child_id", :limit => 8
|
5
|
+
t.integer "parent_id", :limit => 8
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
drop_table :stop_areas_stop_areas
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class CreateChouettePtLink < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table "pt_links", :force => true do |t|
|
4
|
+
t.integer "start_of_link_id", :limit => 8
|
5
|
+
t.integer "end_of_link_id", :limit => 8
|
6
|
+
t.integer "route_id", :limit => 8
|
7
|
+
t.string "objectid", :null => false
|
8
|
+
t.integer "object_version"
|
9
|
+
t.datetime "creation_time"
|
10
|
+
t.string "creator_id"
|
11
|
+
t.string "name"
|
12
|
+
t.string "comment"
|
13
|
+
t.decimal "link_distance", :precision => 19, :scale => 2
|
14
|
+
end
|
15
|
+
add_index "pt_links", ["objectid"], :name => "pt_links_objectid_key", :unique => true
|
16
|
+
end
|
17
|
+
|
18
|
+
def down
|
19
|
+
drop_table :pt_links
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class AddIdToTimeTableDate < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
# active record can't add primary key after table creation
|
4
|
+
# must do SQL direct command
|
5
|
+
execute <<-SQL
|
6
|
+
ALTER TABLE time_table_dates ADD COLUMN id bigserial
|
7
|
+
SQL
|
8
|
+
execute <<-SQL
|
9
|
+
ALTER TABLE time_table_dates ADD CONSTRAINT time_table_dates_pkey PRIMARY KEY (id)
|
10
|
+
SQL
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class AddIdToTimeTablePeriod < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
# active record can't add primary key after table creation
|
4
|
+
# must do SQL direct command
|
5
|
+
execute <<-SQL
|
6
|
+
ALTER TABLE time_table_periods ADD COLUMN id bigserial
|
7
|
+
SQL
|
8
|
+
execute <<-SQL
|
9
|
+
ALTER TABLE time_table_periods ADD CONSTRAINT time_table_periods_pkey PRIMARY KEY (id)
|
10
|
+
SQL
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class AddFieldsToAccessPoints < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
remove_column "access_points", "mobility_restricted_suitability"
|
4
|
+
remove_column "access_points", "stairs_availability"
|
5
|
+
add_column "access_points", "mobility_restricted_suitability", "boolean"
|
6
|
+
add_column "access_points", "stairs_availability", "boolean"
|
7
|
+
rename_column "access_points", "type","access_type"
|
8
|
+
change_column "access_points", "openning_time","time"
|
9
|
+
change_column "access_points", "closing_time","time"
|
10
|
+
add_column "access_points", "stop_area_id", "integer", {:limit => 8}
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Dir["#{File.dirname(__FILE__)}/factories/*.rb"].each {|f| require f}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Factory.define :access_link, :class => "Chouette::AccessLink" do |link|
|
2
|
+
link.sequence(:name) { |n| "Access link #{n}" }
|
3
|
+
link.link_type "Mixed"
|
4
|
+
link.link_orientation "AccessPointToStopArea"
|
5
|
+
link.sequence(:objectid) { |n| "test:AccessLink:#{n}" }
|
6
|
+
|
7
|
+
link.association :stop_area, :factory => :stop_area
|
8
|
+
link.association :access_point, :factory => :access_point
|
9
|
+
|
10
|
+
end
|
11
|
+
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Factory.define :access_point, :class => "Chouette::AccessPoint" do |access_point|
|
2
|
+
access_point.latitude 10 * rand
|
3
|
+
access_point.longitude 10 * rand
|
4
|
+
access_point.sequence(:name) { |n| "AccessPoint #{n}" }
|
5
|
+
access_point.access_type "InOut"
|
6
|
+
access_point.sequence(:objectid) { |n| "test:AccessPoint:#{n}" }
|
7
|
+
access_point.association :stop_area, :factory => :stop_area
|
8
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Factory.define :connection_link, :class => "Chouette::ConnectionLink" do |link|
|
2
|
+
link.sequence(:name) { |n| "Connection link #{n}" }
|
3
|
+
link.sequence(:link_type) { |n| "Mixed" }
|
4
|
+
link.sequence(:objectid) { |n| "test:ConnectionLink:#{n}" }
|
5
|
+
|
6
|
+
link.association :departure, :factory => :stop_area
|
7
|
+
link.association :arrival, :factory => :stop_area
|
8
|
+
|
9
|
+
|
10
|
+
end
|
11
|
+
|