Fix info ids.
authorlain <lain@soykaf.club>
Wed, 23 Jan 2019 13:00:23 +0000 (14:00 +0100)
committerlain <lain@soykaf.club>
Wed, 23 Jan 2019 13:01:44 +0000 (14:01 +0100)
The previous migration actually created values for the key "id", including the
quotes. This one should fill out all missing ids.

Closes #511

priv/repo/migrations/20190123125839_fix_info_ids.exs [new file with mode: 0644]

diff --git a/priv/repo/migrations/20190123125839_fix_info_ids.exs b/priv/repo/migrations/20190123125839_fix_info_ids.exs
new file mode 100644 (file)
index 0000000..2b4c2b5
--- /dev/null
@@ -0,0 +1,9 @@
+defmodule Pleroma.Repo.Migrations.FixInfoIds do
+  use Ecto.Migration
+
+  def change do
+    execute(
+      "update users set info = jsonb_set(info, '{id}', to_jsonb(uuid_generate_v4())) where info->'id' is null;"
+    )
+  end
+end