summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2018-12-01 12:00:33 +0100
committerlain <lain@soykaf.club>2018-12-01 12:00:33 +0100
commit4996fb07d829a5c93fe97a6f3364f3032fb2c1bb (patch)
tree4398bdf8bba1aeec61c191dec9c1d0f2b52ce110
parent347df6421d6b1794a39ac6ce9e24a9e51e136a62 (diff)
downloadpleroma-4996fb07d829a5c93fe97a6f3364f3032fb2c1bb.tar.gz
pleroma-4996fb07d829a5c93fe97a6f3364f3032fb2c1bb.zip
Genereate uuids for existing info fields.
-rw-r--r--priv/repo/migrations/20181201104428_add_uuid_extension.exs7
-rw-r--r--priv/repo/migrations/20181201105617_add_uui_ds_to_user_info.exs7
2 files changed, 14 insertions, 0 deletions
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