Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

23 řádky
548B

  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Repo.Migrations.ConfirmLoggedInUsers do
  5. use Ecto.Migration
  6. import Ecto.Query
  7. alias Pleroma.Repo
  8. alias Pleroma.User
  9. alias Pleroma.Web.OAuth.Token
  10. def up do
  11. User
  12. |> where([u], u.is_confirmed == false)
  13. |> join(:inner, [u], t in Token, on: t.user_id == u.id)
  14. |> Repo.update_all(set: [is_confirmed: true])
  15. end
  16. def down do
  17. :noop
  18. end
  19. end