FIXES FRMW-2676 **What** ref: https://discord.com/channels/876835651130097704/1023889804544458752/threads/1276979858781503528 Currently, when providing the following ```ts const user1 = manager.create(User, { username: "User 1", team: { name: "Team 1", }, }) ``` It would result in an error inserting into the database because the foreign key will be sent twice as part of the insert, one for the relation and one for the foreign key that both relate to the foreign key property. To fix that and allow both approaches (providing the entity to cascade persist or just providing the foreign key in case of another side nullable relation) we need to handle it a bit differently. now both approaches would be valid. the entities for the example might not be the best ones but it is just to illustrate option 1 - we create both the user and the team: ```ts const user1 = manager.create(User, { username: "User 1", team: { name: "Team 1", }, }) ``` option 2 - the team already exists (for example the previous user have been detached from the team but we kept the team alive and assign a new user to that team) : ```ts const user1 = manager.create(User, { username: "User 1", team_id: team.id }) ```
Medusa
Documentation | Website
Building blocks for digital commerce
Getting Started
Visit the Quickstart Guide to set up a server.
Visit the Docs to learn more about our system requirements.
What is Medusa
Medusa is a set of commerce modules and tools that allow you to build rich, reliable, and performant commerce applications without reinventing core commerce logic. The modules can be customized and used to build advanced ecommerce stores, marketplaces, or any product that needs foundational commerce primitives. All modules are open-source and freely available on npm.
Learn more about Medusa’s architecture and commerce modules in the Docs.
Roadmap, Upgrades & Plugins
You can view the planned, started and completed features in the Roadmap discussion.
Follow the Upgrade Guides to keep your Medusa project up-to-date.
Check out all available Medusa plugins.
Community & Contributions
The community and core team are available in GitHub Discussions, where you can ask for support, discuss roadmap, and share ideas.
Our Contribution Guide describes how to contribute to the codebase and Docs.
Join our Discord server to meet other community members.
Other channels
License
Licensed under the MIT License.