Powered by AppSignal & Oban Pro

find old location infos

find old location infos.livemd

find old location infos

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

import Ecto.Query
require Ash.Query

Section

MyApp.LegacyEvent
|> select([a], a.alternative_location)
|> distinct([a], a.alternative_location)
#  |> MyApp.Repo.aggregate(:count)
#  |> limit(10)

|> Repo.all()
|> Enum.map(fn str ->
  String.split("#{str}", ",", trim: true)
  |> case do
    [first | _rest] -> first
    _ -> str
  end
end)
|> Enum.map(fn a -> Slug.slugify("#{a}") end)
|> Enum.uniq()
|> Enum.map(fn a -> %{slug: a} end)
|> Kino.DataTable.new()