summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20190123125839_fix_info_ids.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-01-23 14:00:23 +0100
committerlain <lain@soykaf.club>2019-01-23 14:01:44 +0100
commitab03f8121979d541f41ce8581865f755329d6dc8 (patch)
tree085a2eea5df19d73b67831eb0802b66140771bfa /priv/repo/migrations/20190123125839_fix_info_ids.exs
parent5067b791a124960e3561ff77065a36d45abd2552 (diff)
downloadpleroma-ab03f8121979d541f41ce8581865f755329d6dc8.tar.gz
pleroma-ab03f8121979d541f41ce8581865f755329d6dc8.zip
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
Diffstat (limited to 'priv/repo/migrations/20190123125839_fix_info_ids.exs')
-rw-r--r--priv/repo/migrations/20190123125839_fix_info_ids.exs9
1 files changed, 9 insertions, 0 deletions
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