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

  def change do
    create table(:hrrr_climatology, primary_key: false) do
      add :id, :binary_id, primary_key: true, null: false
      add :lat, :float, null: false
      add :lon, :float, null: false
      add :month, :integer, null: false
      add :hour, :integer, null: false
      add :mean_surface_temp_c, :float
      add :stddev_surface_temp_c, :float
      add :sample_count, :integer
    end

    create unique_index(:hrrr_climatology, [:lat, :lon, :month, :hour])
    create index(:hrrr_climatology, [:month, :hour])
  end
end
