defmodule Memex.Repo.Migrations.SetUtcDatetime do
  use Ecto.Migration

  def change do
    alter table(:users) do
      modify :confirmed_at, :utc_datetime_usec, from: :naive_datetime
      modify :inserted_at, :utc_datetime_usec, from: :naive_datetime
      modify :updated_at, :utc_datetime_usec, from: :naive_datetime
    end

    alter table(:users_tokens) do
      modify :inserted_at, :utc_datetime_usec, from: :naive_datetime
    end

    alter table(:invites) do
      modify :disabled_at, :utc_datetime_usec, from: :naive_datetime
      modify :inserted_at, :utc_datetime_usec, from: :naive_datetime
      modify :updated_at, :utc_datetime_usec, from: :naive_datetime
    end

    alter table(:contexts) do
      modify :inserted_at, :utc_datetime_usec, from: :naive_datetime
      modify :updated_at, :utc_datetime_usec, from: :naive_datetime
    end

    alter table(:notes) do
      modify :inserted_at, :utc_datetime_usec, from: :naive_datetime
      modify :updated_at, :utc_datetime_usec, from: :naive_datetime
    end

    alter table(:pipelines) do
      modify :inserted_at, :utc_datetime_usec, from: :naive_datetime
      modify :updated_at, :utc_datetime_usec, from: :naive_datetime
    end

    alter table(:steps) do
      modify :inserted_at, :utc_datetime_usec, from: :naive_datetime
      modify :updated_at, :utc_datetime_usec, from: :naive_datetime
    end
  end
end
