Strapi v4 M-to-M Creates Two Join Table?

System Information
  • Strapi Version: 4.5.3
  • Operating System: Ubuntu
  • Database: Postgres
  • Node Version: 18.12.1
  • NPM Version: 8.19.2
  • Yarn Version: 1.22.19

I created two content type: Event & Nelayan
Nelayan means Fisherman anyway, we just stick with our original language for some reason

Then, via Admin UI, i create the many to many relation between that two
It then generates the schema.json

Then when I see the database via PGAdmin, I see new table created as the join table

The question is, why there are two join table instead of one?

When i try create some fisherman/nelayan and ‘attach’ to one event, only one join table updated
While others still empty

When you updated did you follow the migration guides?

migration guides? sorry I am not migrate from any previous version
I use Strapi just from this January and it’s already v4.5.3

Anw if you courious how to reproduce it, I make the relation via admin UI like this

Just try it, create brand new strapi app, create two content type, then make the m-to-m relations
I believe you will get same result: two join table

correct this issue is in the migration guide so if you upgrade and follow the migration staps this issue would be fixed

Got it!
I believe the migration docs you want me to reference is this

The docs said that in the schema.json, one table should have inversedBy & another side should have mappedBy attribute. But the schema.json generated by admin UI placing inversedBy in both table. This causing dual join table. It solved by manually edit the schema.json to adhere the guides in above docs