v2.5.0 ecto.migrate error: function associated_object_id(jsonb) does not exist
I'm trying to migrate to v2.5.0 on Debian 10 and running into the following error that is making the database migration fail:
00:23:07.391 [info] == Running 20210205145000 Pleroma.Repo.Migrations.MovePinnedActivitiesIntoPinnedObjects.up/0 forward
** (Postgrex.Error) ERROR 42883 (undefined_function) function associated_object_id(jsonb) does not exist
query: SELECT a0."id", a0."data", a0."local", a0."actor", a0."recipients", a0."inserted_at", a0."updated_at", o1."id", o1."data", o1."inserted_at", o1."updated_at" FROM "activities" AS a0 INNER JOIN "objects" AS o1 ON (o1."data"->>'id') = associated_object_id(a0."data") WHERE (a0."id" = ANY($1))
hint: No function matches the given name and argument types. You might need to add explicit type casts.
(ecto_sql 3.9.0) lib/ecto/adapters/sql.ex:905: Ecto.Adapters.SQL.raise_sql_call_error/1
(ecto_sql 3.9.0) lib/ecto/adapters/sql.ex:820: Ecto.Adapters.SQL.execute/6
(ecto 3.9.2) lib/ecto/repo/queryable.ex:229: Ecto.Repo.Queryable.execute/4
(ecto 3.9.2) lib/ecto/repo/queryable.ex:19: Ecto.Repo.Queryable.all/3
_build/prod/lib/pleroma/priv/repo/migrations/20210205145000_move_pinned_activities_into_pinned_objects.exs:18: anonymous fn/1 in Pleroma.Repo.Migrations.MovePinnedActivitiesIntoPinnedObjects.up/0
(elixir 1.11.2) lib/stream.ex:441: anonymous fn/4 in Stream.each/2
(elixir 1.11.2) lib/enum.ex:3764: Enumerable.List.reduce/3
(elixir 1.11.2) lib/stream.ex:931: Stream.do_list_transform/7
The Postgres version is 12.13. I was on 11.9 before and had seen a similar issue about this when running versions older than 12, thought maybe updating to a newer version of Postgres would help but it's the same issue I was getting before.
I haven't found any information anywhere about an error like this but I also am not super knowledgeable about Postgres so I don't know if it's some simple thing or if the database is screwed up somehow. I hadn't touched Pleroma since installing it in Feb 2021.
Edited by Nyx Land