2022-02-26 06:11:42 +00:00
|
|
|
# Pleroma: A lightweight social networking server
|
|
|
|
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-12-22 19:04:33 +00:00
|
|
|
defmodule Pleroma.Repo.Migrations.CreateHashtagsObjects do
|
|
|
|
use Ecto.Migration
|
|
|
|
|
|
|
|
def change do
|
2021-01-07 09:20:29 +00:00
|
|
|
create_if_not_exists table(:hashtags_objects, primary_key: false) do
|
2021-01-31 19:03:59 +00:00
|
|
|
add(:hashtag_id, references(:hashtags), null: false, primary_key: true)
|
|
|
|
add(:object_id, references(:objects), null: false, primary_key: true)
|
2020-12-22 19:04:33 +00:00
|
|
|
end
|
|
|
|
|
2021-02-22 20:26:07 +00:00
|
|
|
# Note: PK index: "hashtags_objects_pkey" PRIMARY KEY, btree (hashtag_id, object_id)
|
2020-12-22 19:04:33 +00:00
|
|
|
create_if_not_exists(index(:hashtags_objects, [:object_id]))
|
|
|
|
end
|
|
|
|
end
|