Set `users.approval_pending` default to `false`
authorEgor Kislitsyn <egor@kislitsyn.com>
Tue, 11 Aug 2020 13:21:17 +0000 (17:21 +0400)
committerEgor Kislitsyn <egor@kislitsyn.com>
Tue, 11 Aug 2020 13:21:17 +0000 (17:21 +0400)
priv/repo/migrations/20200811125613_set_defaults_to_user_approval_pending.exs [new file with mode: 0644]

diff --git a/priv/repo/migrations/20200811125613_set_defaults_to_user_approval_pending.exs b/priv/repo/migrations/20200811125613_set_defaults_to_user_approval_pending.exs
new file mode 100644 (file)
index 0000000..eec7da0
--- /dev/null
@@ -0,0 +1,15 @@
+defmodule Pleroma.Repo.Migrations.SetDefaultsToUserApprovalPending do
+  use Ecto.Migration
+
+  def up do
+    execute("UPDATE users SET approval_pending = false WHERE approval_pending IS NULL")
+
+    alter table(:users) do
+      modify(:approval_pending, :boolean, default: false, null: false)
+    end
+  end
+
+  def down do
+    :ok
+  end
+end