summaryrefslogtreecommitdiff
path: root/lib/pleroma/hashtag_object.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/hashtag_object.ex')
-rw-r--r--lib/pleroma/hashtag_object.ex17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/pleroma/hashtag_object.ex b/lib/pleroma/hashtag_object.ex
new file mode 100644
index 000000000..12b570715
--- /dev/null
+++ b/lib/pleroma/hashtag_object.ex
@@ -0,0 +1,17 @@
+defmodule Pleroma.HashtagObject do
+ @moduledoc """
+ Through table relationship between hashtags and objects.
+ https://hexdocs.pm/ecto/polymorphic-associations-with-many-to-many.html
+ """
+ use Ecto.Schema
+
+ alias Pleroma.Hashtag
+ alias Pleroma.Object
+
+ @primary_key false
+
+ schema "hashtags_objects" do
+ belongs_to(:hashtag, Hashtag)
+ belongs_to(:object, Object, type: FlakeId.Ecto.CompatType)
+ end
+end