From ab03f8121979d541f41ce8581865f755329d6dc8 Mon Sep 17 00:00:00 2001 From: lain Date: Wed, 23 Jan 2019 14:00:23 +0100 Subject: [PATCH] Fix info ids. 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 | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 priv/repo/migrations/20190123125839_fix_info_ids.exs diff --git a/priv/repo/migrations/20190123125839_fix_info_ids.exs b/priv/repo/migrations/20190123125839_fix_info_ids.exs new file mode 100644 index 000000000..2b4c2b5a9 --- /dev/null +++ b/priv/repo/migrations/20190123125839_fix_info_ids.exs @@ -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