Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

21 Zeilen
813B

  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Repo.Migrations.RefactorApprovalPendingUserField do
  5. use Ecto.Migration
  6. def up do
  7. # Flip the values before we change the meaning of the column
  8. execute("UPDATE users SET approval_pending = NOT approval_pending;")
  9. execute("ALTER TABLE users RENAME COLUMN approval_pending TO is_approved;")
  10. execute("ALTER TABLE users ALTER COLUMN is_approved SET DEFAULT true;")
  11. end
  12. def down do
  13. execute("UPDATE users SET is_approved = NOT is_approved;")
  14. execute("ALTER TABLE users RENAME COLUMN is_approved TO approval_pending;")
  15. execute("ALTER TABLE users ALTER COLUMN approval_pending SET DEFAULT false;")
  16. end
  17. end