defmodule Radiator.Repo.Migrations.CreateShows 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
    create table(:shows, primary_key: false) do
      add :id, :uuid, null: false, default: fragment("gen_random_uuid()"), primary_key: true
      add :title, :text, null: false
      add :subtitle, :text
      add :summary, :text
      add :nmemonic, :text
      add :language, :text
      add :itunes_type, :text, default: "serial"
      add :license_name, :text
      add :license_url, :text
      add :author, :text
      add :itunes_category, {:array, :text}, null: false, default: []
      add :blocked, :boolean, null: false, default: false
      add :explicit, :boolean, null: false, default: false
      add :complete, :boolean, null: false, default: false
      add :donation_url, :text
      add :donation_description, :text

      add :inserted_at, :utc_datetime_usec,
        null: false,
        default: fragment("(now() AT TIME ZONE 'utc')")

      add :updated_at, :utc_datetime_usec,
        null: false,
        default: fragment("(now() AT TIME ZONE 'utc')")
    end
  end

  def down do
    drop table(:shows)
  end
end
