summaryrefslogtreecommitdiff
path: root/priv/repo
diff options
context:
space:
mode:
Diffstat (limited to 'priv/repo')
-rw-r--r--priv/repo/migrations/20180516144508_add_trigram_extension.exs6
-rw-r--r--priv/repo/migrations/20190710125158_add_following_address_from_source_data.exs2
-rw-r--r--priv/repo/migrations/20191118084500_data_migration_populate_user_relationships.exs2
-rw-r--r--priv/repo/migrations/20200811143147_ap_id_not_null.exs2
-rw-r--r--priv/repo/migrations/20220527134341_add_quote_url_index_to_objects.exs17
-rw-r--r--priv/repo/migrations/20220905011454_generate_unset_user_keys.exs10
-rw-r--r--priv/repo/migrations/20231107200724_consolidate_email_queues.exs9
7 files changed, 41 insertions, 7 deletions
diff --git a/priv/repo/migrations/20180516144508_add_trigram_extension.exs b/priv/repo/migrations/20180516144508_add_trigram_extension.exs
index b14104cc4..21ead8758 100644
--- a/priv/repo/migrations/20180516144508_add_trigram_extension.exs
+++ b/priv/repo/migrations/20180516144508_add_trigram_extension.exs
@@ -7,13 +7,13 @@ defmodule Pleroma.Repo.Migrations.AddTrigramExtension do
require Logger
def up do
- Logger.warn("ATTENTION ATTENTION ATTENTION\n")
+ Logger.warning("ATTENTION ATTENTION ATTENTION\n")
- Logger.warn(
+ Logger.warning(
"This will try to create the pg_trgm extension on your database. If your database user does NOT have the necessary rights, you will have to do it manually and re-run the migrations.\nYou can probably do this by running the following:\n"
)
- Logger.warn(
+ Logger.warning(
"sudo -u postgres psql pleroma_dev -c \"create extension if not exists pg_trgm\"\n"
)
diff --git a/priv/repo/migrations/20190710125158_add_following_address_from_source_data.exs b/priv/repo/migrations/20190710125158_add_following_address_from_source_data.exs
index 44a3d6d2d..3a1bf677b 100644
--- a/priv/repo/migrations/20190710125158_add_following_address_from_source_data.exs
+++ b/priv/repo/migrations/20190710125158_add_following_address_from_source_data.exs
@@ -26,7 +26,7 @@ defmodule Pleroma.Repo.Migrations.AddFollowingAddressFromSourceData do
|> Pleroma.Repo.update()
user ->
- Logger.warn("User #{user.id} / #{user.nickname} does not seem to have source_data")
+ Logger.warning("User #{user.id} / #{user.nickname} does not seem to have source_data")
end)
end
end
diff --git a/priv/repo/migrations/20191118084500_data_migration_populate_user_relationships.exs b/priv/repo/migrations/20191118084500_data_migration_populate_user_relationships.exs
index 571a75160..6fa671a79 100644
--- a/priv/repo/migrations/20191118084500_data_migration_populate_user_relationships.exs
+++ b/priv/repo/migrations/20191118084500_data_migration_populate_user_relationships.exs
@@ -63,7 +63,7 @@ defmodule Pleroma.Repo.Migrations.DataMigrationPopulateUserRelationships do
ON CONFLICT (source_id, relationship_type, target_id) DO NOTHING
""")
else
- _ -> Logger.warn("Unresolved #{field} reference: (#{source_uuid}, #{target_id})")
+ _ -> Logger.warning("Unresolved #{field} reference: (#{source_uuid}, #{target_id})")
end
end
end
diff --git a/priv/repo/migrations/20200811143147_ap_id_not_null.exs b/priv/repo/migrations/20200811143147_ap_id_not_null.exs
index a160daef4..dbc226663 100644
--- a/priv/repo/migrations/20200811143147_ap_id_not_null.exs
+++ b/priv/repo/migrations/20200811143147_ap_id_not_null.exs
@@ -8,7 +8,7 @@ defmodule Pleroma.Repo.Migrations.ApIdNotNull do
require Logger
def up do
- Logger.warn(
+ Logger.warning(
"If this migration fails please open an issue at https://git.pleroma.social/pleroma/pleroma/-/issues/new \n"
)
diff --git a/priv/repo/migrations/20220527134341_add_quote_url_index_to_objects.exs b/priv/repo/migrations/20220527134341_add_quote_url_index_to_objects.exs
new file mode 100644
index 000000000..d77db34cd
--- /dev/null
+++ b/priv/repo/migrations/20220527134341_add_quote_url_index_to_objects.exs
@@ -0,0 +1,17 @@
+# 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.AddQuoteUrlIndexToObjects do
+ use Ecto.Migration
+ @disable_ddl_transaction true
+
+ def change do
+ create_if_not_exists(
+ index(:objects, ["(data->'quoteUrl')"],
+ name: :objects_quote_url,
+ concurrently: true
+ )
+ )
+ end
+end
diff --git a/priv/repo/migrations/20220905011454_generate_unset_user_keys.exs b/priv/repo/migrations/20220905011454_generate_unset_user_keys.exs
index 43bc7100b..580c38841 100644
--- a/priv/repo/migrations/20220905011454_generate_unset_user_keys.exs
+++ b/priv/repo/migrations/20220905011454_generate_unset_user_keys.exs
@@ -2,12 +2,20 @@
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
+defmodule User do
+ use Ecto.Schema
+
+ schema "users" do
+ field(:keys, :string)
+ field(:local, :boolean, default: true)
+ end
+end
+
defmodule Pleroma.Repo.Migrations.GenerateUnsetUserKeys do
use Ecto.Migration
import Ecto.Query
alias Pleroma.Keys
alias Pleroma.Repo
- alias Pleroma.User
def change do
query =
diff --git a/priv/repo/migrations/20231107200724_consolidate_email_queues.exs b/priv/repo/migrations/20231107200724_consolidate_email_queues.exs
new file mode 100644
index 000000000..63f5af369
--- /dev/null
+++ b/priv/repo/migrations/20231107200724_consolidate_email_queues.exs
@@ -0,0 +1,9 @@
+defmodule Pleroma.Repo.Migrations.ConsolidateEmailQueues do
+ use Ecto.Migration
+
+ def change do
+ execute(
+ "UPDATE oban_jobs SET queue = 'mailer' WHERE queue in ('digest_emails', 'new_users_digest')"
+ )
+ end
+end