pleroma/priv/repo/migrations/20230809231846_add_published_index_to_activities.exs

13 lines
354 B
Elixir
Raw Normal View History

defmodule Pleroma.Repo.Migrations.AddPublishedIndexToActivities do
use Ecto.Migration
def change do
create_if_not_exists(
index(:activities, ["case when data->>'type' = 'Create' then (data->'object'->>'published')::timestamptz else inserted_at end"],
name: :activities_published,
concurrently: true
)
)
end
end