~ihabunek/triglav

ref: 7bdb88d4d88886e08c456f7ee012d7a343a73731 triglav/lib/triglav/schemas/public_transport/platform.ex -rw-r--r-- 637 bytes
7bdb88d4Ivan Habunek Split validation from persisting errors 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
defmodule Triglav.Schemas.PublicTransport.Platform do
  @moduledoc """
  Contains extended information for a public transport stop.
  """
  use Ecto.Schema

  alias Triglav.Schemas.Osmosis
  alias Triglav.Schemas.Zet

  @type t :: %__MODULE__{}

  @primary_key false

  schema "public_transport_platforms" do
    belongs_to :relation, Osmosis.Relation, primary_key: true
    belongs_to :stop, Zet.Stop, type: :binary
    belongs_to :route, Zet.Route, type: :binary
    belongs_to :node, Osmosis.Node
    belongs_to :way, Osmosis.Way
    field :sequence_id, :integer, primary_key: true
    field :geometry, Geo.PostGIS.Geometry
  end
end