defmodule Microwaveprop.Repo.Migrations.CreateIonosondeObservations do
  use Ecto.Migration

  def change do
    create table(:ionosonde_observations, primary_key: false) do
      add :id, :binary_id, primary_key: true
      add :station_code, :string, null: false
      add :valid_time, :utc_datetime, null: false
      add :confidence_score, :integer
      add :fo_f2_mhz, :float
      add :fo_e_mhz, :float
      add :fo_es_mhz, :float
      add :hm_f2_km, :float
      add :mufd_mhz, :float

      timestamps(type: :utc_datetime)
    end

    create unique_index(:ionosonde_observations, [:station_code, :valid_time])
    create index(:ionosonde_observations, [:valid_time])
  end
end
