defmodule WandererApp.Repo.Migrations.EncryptCharacterAttr 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(:character_v1) do
      remove :wallet_balance
      remove :ship
      remove :structure_id
      remove :solar_system_id
      remove :location
      remove :refresh_token
      remove :access_token
      add :encrypted_location, :binary
      add :encrypted_ship, :binary
      add :encrypted_solar_system_id, :binary
      add :encrypted_structure_id, :binary
      add :encrypted_access_token, :binary
      add :encrypted_refresh_token, :binary
    end
  end

  def down do
    alter table(:character_v1) do
      remove :encrypted_refresh_token
      remove :encrypted_access_token
      remove :encrypted_structure_id
      remove :encrypted_solar_system_id
      remove :encrypted_ship
      remove :encrypted_location
      add :access_token, :text
      add :refresh_token, :text
      add :location, :text
      add :solar_system_id, :bigint
      add :structure_id, :bigint
      add :ship, :bigint
      add :wallet_balance, :text
    end
  end
end
