summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs18
-rw-r--r--priv/repo/migrations/20191005165212_add_unread_conversation_count_to_user_info.exs11
-rw-r--r--priv/repo/migrations/20191006123824_add_keys_column.exs9
-rw-r--r--priv/repo/migrations/20191006135457_move_keys_to_separate_column.exs7
-rw-r--r--priv/static/schemas/litepub-0.1.jsonld7
5 files changed, 29 insertions, 23 deletions
diff --git a/priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs b/priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs
index 50669902e..b717cab2e 100644
--- a/priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs
+++ b/priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs
@@ -3,22 +3,6 @@ defmodule Pleroma.Repo.Migrations.CopyMutedToMutedNotifications do
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)
+ execute("update users set info = jsonb_set(info, '{muted_notifications}', info->'mutes', true) where local = true")
end
end
diff --git a/priv/repo/migrations/20191005165212_add_unread_conversation_count_to_user_info.exs b/priv/repo/migrations/20191005165212_add_unread_conversation_count_to_user_info.exs
new file mode 100644
index 000000000..2aa1a012c
--- /dev/null
+++ b/priv/repo/migrations/20191005165212_add_unread_conversation_count_to_user_info.exs
@@ -0,0 +1,11 @@
+defmodule Pleroma.Repo.Migrations.AddUnreadConversationCountToUserInfo do
+ use Ecto.Migration
+
+ def up do
+ execute("""
+ update users set info = jsonb_set(info, '{unread_conversation_count}', 0::varchar::jsonb, true) where local=true
+ """)
+ end
+
+ def down, do: :ok
+end
diff --git a/priv/repo/migrations/20191006123824_add_keys_column.exs b/priv/repo/migrations/20191006123824_add_keys_column.exs
new file mode 100644
index 000000000..b6c615646
--- /dev/null
+++ b/priv/repo/migrations/20191006123824_add_keys_column.exs
@@ -0,0 +1,9 @@
+defmodule Pleroma.Repo.Migrations.AddKeysColumn do
+ use Ecto.Migration
+
+ def change do
+ alter table("users") do
+ add_if_not_exists :keys, :text
+ end
+ end
+end
diff --git a/priv/repo/migrations/20191006135457_move_keys_to_separate_column.exs b/priv/repo/migrations/20191006135457_move_keys_to_separate_column.exs
new file mode 100644
index 000000000..504dde53a
--- /dev/null
+++ b/priv/repo/migrations/20191006135457_move_keys_to_separate_column.exs
@@ -0,0 +1,7 @@
+defmodule Pleroma.Repo.Migrations.MoveKeysToSeparateColumn do
+ use Ecto.Migration
+
+ def change do
+ execute("update users set keys = info->>'keys' where local", "update users set info = jsonb_set(info, '{keys}'::text[], to_jsonb(keys)) where local")
+ end
+end
diff --git a/priv/static/schemas/litepub-0.1.jsonld b/priv/static/schemas/litepub-0.1.jsonld
index f01c2c33a..1cfcb7ec7 100644
--- a/priv/static/schemas/litepub-0.1.jsonld
+++ b/priv/static/schemas/litepub-0.1.jsonld
@@ -14,9 +14,8 @@
"discoverable": "toot:discoverable",
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
"ostatus": "http://ostatus.org#",
- "schema": "http://schema.org",
+ "schema": "http://schema.org#",
"toot": "http://joinmastodon.org/ns#",
- "totalItems": "as:totalItems",
"value": "schema:value",
"sensitive": "as:sensitive",
"litepub": "http://litepub.social/ns#",
@@ -28,10 +27,6 @@
"oauthRegistrationEndpoint": {
"@id": "litepub:oauthRegistrationEndpoint",
"@type": "@id"
- },
- "uploadMedia": {
- "@id": "litepub:uploadMedia",
- "@type": "@id"
}
}
]