mix.exs: Make copyright regexes more precise
[akkoma] / priv / repo / migrations / 20201231185546_confirm_logged_in_users.exs
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
5 defmodule Pleroma.Repo.Migrations.ConfirmLoggedInUsers do
6 use Ecto.Migration
7 import Ecto.Query
8 alias Pleroma.Repo
9 alias Pleroma.User
10 alias Pleroma.Web.OAuth.Token
11
12 def up do
13 User
14 |> where([u], u.confirmation_pending == true)
15 |> join(:inner, [u], t in Token, on: t.user_id == u.id)
16 |> Repo.update_all(set: [confirmation_pending: false])
17 end
18
19 def down do
20 :noop
21 end
22 end