Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags...
[akkoma] / priv / repo / migrations / 20201221203824_create_hashtags_objects.exs
1 defmodule Pleroma.Repo.Migrations.CreateHashtagsObjects do
2 use Ecto.Migration
3
4 def change do
5 create_if_not_exists table(:hashtags_objects) do
6 add(:hashtag_id, references(:hashtags), null: false)
7 add(:object_id, references(:objects), null: false)
8 end
9
10 create_if_not_exists(unique_index(:hashtags_objects, [:hashtag_id, :object_id]))
11 create_if_not_exists(index(:hashtags_objects, [:object_id]))
12 end
13 end