defmodule Orcasite.Repo.Migrations.UpdateSegmentTimestampResolutions do
  @moduledoc """
  Updates resources based on their most recent snapshots.

  This file was autogenerated with `mix ash_postgres.generate_migrations`
  """

  use Ecto.Migration

  def up do
    alter table(:feed_streams) do
      modify :end_time, :utc_datetime_usec
      modify :start_time, :utc_datetime_usec
    end

    alter table(:feed_segments) do
      modify :end_time, :utc_datetime_usec
      modify :start_time, :utc_datetime_usec
    end

    alter table(:bouts) do
      modify :end_time, :utc_datetime_usec
      modify :start_time, :utc_datetime_usec
    end
  end

  def down do
    alter table(:bouts) do
      modify :start_time, :utc_datetime
      modify :end_time, :utc_datetime
    end

    alter table(:feed_segments) do
      modify :start_time, :utc_datetime
      modify :end_time, :utc_datetime
    end

    alter table(:feed_streams) do
      modify :start_time, :utc_datetime
      modify :end_time, :utc_datetime
    end
  end
end
