-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Closed
Copy link
Description
Bug report
Describe the bug
A problem occured when creating a "Has one" relation between collections.
Assume there are "employee" and "company" collections. Then "employees" and "companies" tables exist in the database.
I created a "Has one" relation between "employee" and "company" collections on Strapi CMS.
In v3, "company_id" column is created in "employees" table. But, in v4, creates the mapping table "employees_company_id_links".
I'm not sure if this is an intended feature or a bug, so I'm creating this issue.
Steps to reproduce the behavior
- Create "employee" and "company" collections.
- Create a "employee has one Company" relation in the "employee" collection.
- Check the database table.
Expected behavior
A "company_id" column is added as a foreign key to the "employees" table.
Screenshots
Code snippets
https://github.com/lejinseop/strapi-v4-database-relation-test
System
- Node.js version: 14.15.5
- NPM version: 8.1.4
- Strapi version: 4.0.0-beta.17
- Database: Postgres 13.4
- Operating system: MAC OS (PostgresDB in docker container)
Additional context
none
Metadata
Metadata
Assignees
Labels
No labels






