summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2021-02-22 23:26:07 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2021-02-22 23:26:07 +0300
commit6531eddf361fa52db3906ab011a4e33c7a5f9552 (patch)
treedf2606b2c45d0844a75fc2c96c61d3e28eccddfa /priv
parent998437d4a4111055e019f28dd84a8af1f9a27047 (diff)
[#3213] `hashtags`: altered `name` type to `text`. `hashtags_objects`: removed unused index. HashtagsTableMigrator: records_per_second calculation fix. ActivityPub: hashtags-related options normalization.
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20201221203824_create_hashtags_objects.exs2
-rw-r--r--priv/repo/migrations/20210222183840_remove_hashtags_objects_duplicate_index.exs11
-rw-r--r--priv/repo/migrations/20210222184616_change_hashtags_name_to_text.exs15
3 files changed, 27 insertions, 1 deletions
diff --git a/priv/repo/migrations/20201221203824_create_hashtags_objects.exs b/priv/repo/migrations/20201221203824_create_hashtags_objects.exs
index efd60369d..581f32b3c 100644
--- a/priv/repo/migrations/20201221203824_create_hashtags_objects.exs
+++ b/priv/repo/migrations/20201221203824_create_hashtags_objects.exs
@@ -7,7 +7,7 @@ defmodule Pleroma.Repo.Migrations.CreateHashtagsObjects do
add(:object_id, references(:objects), null: false, primary_key: true)
end
- create_if_not_exists(unique_index(:hashtags_objects, [:hashtag_id, :object_id]))
+ # Note: PK index: "hashtags_objects_pkey" PRIMARY KEY, btree (hashtag_id, object_id)
create_if_not_exists(index(:hashtags_objects, [:object_id]))
end
end
diff --git a/priv/repo/migrations/20210222183840_remove_hashtags_objects_duplicate_index.exs b/priv/repo/migrations/20210222183840_remove_hashtags_objects_duplicate_index.exs
new file mode 100644
index 000000000..6c4a2dfdc
--- /dev/null
+++ b/priv/repo/migrations/20210222183840_remove_hashtags_objects_duplicate_index.exs
@@ -0,0 +1,11 @@
+defmodule Pleroma.Repo.Migrations.RemoveHashtagsObjectsDuplicateIndex do
+ use Ecto.Migration
+
+ @moduledoc "Removes `hashtags_objects_hashtag_id_object_id_index` index (duplicate of PK index)."
+
+ def up do
+ drop_if_exists(unique_index(:hashtags_objects, [:hashtag_id, :object_id]))
+ end
+
+ def down, do: nil
+end
diff --git a/priv/repo/migrations/20210222184616_change_hashtags_name_to_text.exs b/priv/repo/migrations/20210222184616_change_hashtags_name_to_text.exs
new file mode 100644
index 000000000..8940b6ca3
--- /dev/null
+++ b/priv/repo/migrations/20210222184616_change_hashtags_name_to_text.exs
@@ -0,0 +1,15 @@
+defmodule Pleroma.Repo.Migrations.ChangeHashtagsNameToText do
+ use Ecto.Migration
+
+ def up do
+ alter table(:hashtags) do
+ modify(:name, :text)
+ end
+ end
+
+ def down do
+ alter table(:hashtags) do
+ modify(:name, :citext)
+ end
+ end
+end