aboutsummaryrefslogtreecommitdiffstats
path: root/db/migrate/20150529134410_create_route_sections.ninoxe_engine.rb
blob: 8e288c8ab22c76d9939df8975a75d24c233c3b0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class CreateRouteSections < ActiveRecord::Migration
  def change
    create_table :route_sections do |t|
      t.belongs_to :departure, limit: 8
      t.belongs_to :arrival, limit: 8

      t.line_string :input_geometry, srid: 4326
      t.line_string :processed_geometry, srid: 4326

      t.string   :objectid, null: false
      t.integer  :object_version
      t.datetime :creation_time
      t.string   :creator_id
    end
    add_foreign_key :route_sections, :stop_areas, column: :departure_id, dependent: :delete
    add_foreign_key :route_sections, :stop_areas, column: :arrival_id, dependent: :delete
  end
end