479 B · text History e569b6d
defmodule CartosnapApp.Repo.Migrations.CreatePhotoTrips do
  use Ecto.Migration

  def change do
    create table(:photo_trips, primary_key: false) do
      add :id, :binary_id, primary_key: true
      add :name, :string
      add :date_start, :date
      add :date_end, :date
      add :meta, :map
      add :geo, :geometry
      add :user, references(:users, on_delete: :nothing, type: :binary_id)

      timestamps()
    end

    create index(:photo_trips, [:user])
  end
end