mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-09-08 20:58:28 +00:00
18 lines
571 B
Elixir
18 lines
571 B
Elixir
defmodule Pleroma.Repo.Migrations.AddIdContraintsToActivitiesAndObjectsPartTwo do
|
|
use Ecto.Migration
|
|
|
|
def up do
|
|
drop_if_exists(index(:objects, ["(data->>\"id\")"], name: :objects_unique_apid_index))
|
|
drop_if_exists(index(:activities, ["(data->>\"id\")"], name: :activities_unique_apid_index))
|
|
|
|
create_if_not_exists(
|
|
unique_index(:objects, ["(data->>'id')"], name: :objects_unique_apid_index)
|
|
)
|
|
|
|
create_if_not_exists(
|
|
unique_index(:activities, ["(data->>'id')"], name: :activities_unique_apid_index)
|
|
)
|
|
end
|
|
|
|
def down, do: :ok
|
|
end
|