From: lain Date: Sat, 1 Dec 2018 11:00:33 +0000 (+0100) Subject: Genereate uuids for existing info fields. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=4996fb07d829a5c93fe97a6f3364f3032fb2c1bb;p=akkoma Genereate uuids for existing info fields. --- diff --git a/priv/repo/migrations/20181201104428_add_uuid_extension.exs b/priv/repo/migrations/20181201104428_add_uuid_extension.exs new file mode 100644 index 000000000..2509e558d --- /dev/null +++ b/priv/repo/migrations/20181201104428_add_uuid_extension.exs @@ -0,0 +1,7 @@ +defmodule Pleroma.Repo.Migrations.AddUUIDExtension do + use Ecto.Migration + + def change do + execute("create extension if not exists \"uuid-ossp\"") + end +end diff --git a/priv/repo/migrations/20181201105617_add_uui_ds_to_user_info.exs b/priv/repo/migrations/20181201105617_add_uui_ds_to_user_info.exs new file mode 100644 index 000000000..9571a1e4d --- /dev/null +++ b/priv/repo/migrations/20181201105617_add_uui_ds_to_user_info.exs @@ -0,0 +1,7 @@ +defmodule Pleroma.Repo.Migrations.AddUUIDsToUserInfo do + use Ecto.Migration + + def change do + execute("update users set info = jsonb_set(info, '{\"id\"}', to_jsonb(uuid_generate_v4()))") + end +end