1 defmodule Pleroma.Repo.Migrations.PopulateUserRawBio do
8 {:ok, _} = Application.ensure_all_started(:fast_sanitize)
10 User.Query.build(%{local: true})
11 |> select([u], struct(u, [:id, :ap_id, :bio]))
13 |> Enum.each(fn %{bio: bio} = user ->
17 |> String.replace(~r(<br */?>), "\n")
18 |> Pleroma.HTML.strip_tags()
20 Ecto.Changeset.cast(user, %{raw_bio: raw_bio}, [:raw_bio])