aboutsummaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20190123125839_fix_info_ids.exs
diff options
context:
space:
mode:
Diffstat (limited to 'priv/repo/migrations/20190123125839_fix_info_ids.exs')
-rw-r--r--priv/repo/migrations/20190123125839_fix_info_ids.exs15
1 files changed, 15 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 0000000..f943e18
--- /dev/null
+++ b/priv/repo/migrations/20190123125839_fix_info_ids.exs
@@ -0,0 +1,15 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Repo.Migrations.FixInfoIds do
+ use Ecto.Migration
+
+ def up do
+ execute(
+ "update users set info = jsonb_set(info, '{id}', to_jsonb(uuid_generate_v4())) where info->'id' is null;"
+ )
+ end
+
+ def down, do: :ok
+end