pleroma/priv/repo/migrations/20230809231846_add_published_index_to_activities.exs
marcin mikołajczak 7da517d23a wip activities_published index
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-03-15 11:09:12 +01:00

12 lines
354 B
Elixir

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