1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Repo.Migrations.PopulateUserRawBio do
12 {:ok, _} = Application.ensure_all_started(:fast_sanitize)
14 User.Query.build(%{local: true})
15 |> select([u], struct(u, [:id, :ap_id, :bio]))
17 |> Enum.each(fn %{bio: bio} = user ->
21 |> String.replace(~r(<br */?>), "\n")
22 |> Pleroma.HTML.strip_tags()
24 Ecto.Changeset.cast(user, %{raw_bio: raw_bio}, [:raw_bio])