summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2020-12-31 14:04:51 -0600
committerAlex Gleason <alex@alexgleason.me>2020-12-31 14:04:51 -0600
commit7b44605cb89943a905f6a0a7aab9ebeea58aa7ab (patch)
tree78c55d2e505bc4b49f8b8cb0268eb98bd88b5feb /priv
parent64f0e96ff692521a8db70fd92196a3e0870f1ddc (diff)
Migration to confirm previously-logged-in users
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20201231185546_confirm_logged_in_users.exs22
1 files changed, 22 insertions, 0 deletions
diff --git a/priv/repo/migrations/20201231185546_confirm_logged_in_users.exs b/priv/repo/migrations/20201231185546_confirm_logged_in_users.exs
new file mode 100644
index 000000000..de2f35169
--- /dev/null
+++ b/priv/repo/migrations/20201231185546_confirm_logged_in_users.exs
@@ -0,0 +1,22 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Repo.Migrations.ConfirmLoggedInUsers do
+ use Ecto.Migration
+ import Ecto.Query
+ alias Pleroma.Repo
+ alias Pleroma.User
+ alias Pleroma.Web.OAuth.Token
+
+ def up do
+ User
+ |> where([u], u.confirmation_pending == true)
+ |> join(:inner, [u], t in Token, on: t.user_id == u.id)
+ |> Repo.update_all(set: [confirmation_pending: false])
+ end
+
+ def down do
+ :noop
+ end
+end