Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
485B

  1. defmodule Pleroma.Repo.Migrations.AddSecondObjectIndexToActivty do
  2. use Ecto.Migration
  3. @disable_ddl_transaction true
  4. def change do
  5. drop_if_exists(
  6. index(:activities, ["(data->'object'->>'id')", "(data->>'type')"],
  7. name: :activities_create_objects_index
  8. )
  9. )
  10. create(
  11. index(:activities, ["(coalesce(data->'object'->>'id', data->>'object'))"],
  12. name: :activities_create_objects_index,
  13. concurrently: true
  14. )
  15. )
  16. end
  17. end