Added migration for setting default tags in existing users records
authoreugenijm <eugenijm@protonmail.com>
Fri, 1 Mar 2019 10:25:32 +0000 (13:25 +0300)
committereugenijm <eugenijm@protonmail.com>
Fri, 1 Mar 2019 11:02:25 +0000 (14:02 +0300)
priv/repo/migrations/20190301101154_add_default_tags_to_user.exs [new file with mode: 0644]

diff --git a/priv/repo/migrations/20190301101154_add_default_tags_to_user.exs b/priv/repo/migrations/20190301101154_add_default_tags_to_user.exs
new file mode 100644 (file)
index 0000000..faeb8f1
--- /dev/null
@@ -0,0 +1,9 @@
+defmodule Pleroma.Repo.Migrations.AddDefaultTagsToUser do
+  use Ecto.Migration
+
+  def up do
+    execute "UPDATE users SET tags = array[]::varchar[] where tags IS NULL"
+  end
+
+  def down, do: :noop
+end