Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

legacy_imgsuche

legacy_imgsuche.livemd

legacy_imgsuche

use QuickAlias, MyAppWeb
use QuickAlias, MyAppBe
use QuickAlias, MyApp

require Ecto.Query
require Ash.Query
import MyApp.MavuEntities.UuidGuards

Section

legacy_events_with_images=
LegacyEvent
|> Ash.Query.filter(string_length(image_adress)>5)
|> Ash.read!()

legacy_events_with_images |> length()
legacy_events_with_missing_images =
  for le <- legacy_events_with_images do
    Event.get_by_legacy_event_id(le.id)
    |> case do
      {:ok, %{image: image}} when is_binary(image) -> nil
      _ -> le
    end
  end
  |> Enum.reject(&amp;is_nil/1)

legacy_events_with_missing_images |> length()