aboutsummaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorSachin Joshi <satchin.joshi@gmail.com>2019-07-15 21:30:56 +0545
committerSachin Joshi <satchin.joshi@gmail.com>2019-07-15 21:30:56 +0545
commit1d906ffa82633af21233c3030fbe2d127b5b77f9 (patch)
treef49175e422b68bee331d437c0dac76ccb5159ed3 /priv
parentf8e3ae61545de45ce4dd395471149ed1e71e0343 (diff)
parent6aa5b39837b943a7a8fd5c6d1d617c74e933e088 (diff)
downloadpleroma-1d906ffa82633af21233c3030fbe2d127b5b77f9.tar.gz
Merge branch 'develop' into match-file-name
# Conflicts: # lib/pleroma/web/media_proxy/media_proxy_controller.ex
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20190516112144_add_ap_id_to_lists.exs26
-rw-r--r--priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs24
-rw-r--r--priv/static/schemas/litepub-0.1.jsonld4
3 files changed, 54 insertions, 0 deletions
diff --git a/priv/repo/migrations/20190516112144_add_ap_id_to_lists.exs b/priv/repo/migrations/20190516112144_add_ap_id_to_lists.exs
new file mode 100644
index 000000000..3c32bc355
--- /dev/null
+++ b/priv/repo/migrations/20190516112144_add_ap_id_to_lists.exs
@@ -0,0 +1,26 @@
+defmodule Pleroma.Repo.Migrations.AddApIdToLists do
+ use Ecto.Migration
+
+ def up do
+ alter table(:lists) do
+ add(:ap_id, :string)
+ end
+
+ execute("""
+ UPDATE lists
+ SET ap_id = u.ap_id || '/lists/' || lists.id
+ FROM users AS u
+ WHERE lists.user_id = u.id
+ """)
+
+ create(unique_index(:lists, :ap_id))
+ end
+
+ def down do
+ drop(index(:lists, [:ap_id]))
+
+ alter table(:lists) do
+ remove(:ap_id)
+ end
+ end
+end
diff --git a/priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs b/priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs
new file mode 100644
index 000000000..50669902e
--- /dev/null
+++ b/priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs
@@ -0,0 +1,24 @@
+defmodule Pleroma.Repo.Migrations.CopyMutedToMutedNotifications do
+ use Ecto.Migration
+ alias Pleroma.User
+
+ def change do
+ query =
+ User.Query.build(%{
+ local: true,
+ active: true,
+ order_by: :id
+ })
+
+ Pleroma.Repo.stream(query)
+ |> Enum.each(fn
+ %{info: %{mutes: mutes} = info} = user ->
+ info_cng =
+ Ecto.Changeset.cast(info, %{muted_notifications: mutes}, [:muted_notifications])
+
+ Ecto.Changeset.change(user)
+ |> Ecto.Changeset.put_embed(:info, info_cng)
+ |> Pleroma.Repo.update()
+ end)
+ end
+end
diff --git a/priv/static/schemas/litepub-0.1.jsonld b/priv/static/schemas/litepub-0.1.jsonld
index f36b231c5..57ed05eba 100644
--- a/priv/static/schemas/litepub-0.1.jsonld
+++ b/priv/static/schemas/litepub-0.1.jsonld
@@ -20,6 +20,10 @@
"sensitive": "as:sensitive",
"litepub": "http://litepub.social/ns#",
"directMessage": "litepub:directMessage",
+ "listMessage": {
+ "@id": "litepub:listMessage",
+ "@type": "@id"
+ },
"oauthRegistrationEndpoint": {
"@id": "litepub:oauthRegistrationEndpoint",
"@type": "@id"