Open NavidMitchell opened 11 months ago
This has been partially fixed. The first case listed above is fixed. But if you use the same name across different projects in the same namespace you will have the same problem.
I have fixed all cases where the object is shared. There is still a problem if multiple models that are different but have the same name. This is talked about in the description.
Currently Structures does not play nice when a Model is shared between different Entities.
Example below will throw errors when GraphQL dashboard is loaded.
It turns out this also breaks OpenAPI if a Model on two unrelated Entities where the Model has the same name but the definitions are different.
To solve this we need to support inside of Structures Models as a first class citizen. This can be done by adding a new Table to store Models. Will be stored with a Name, Namespace, potentially a version and the C3Type. Then the Entity C3Type will have a Reference to the Model. This will allow verification during saving.
Additionally, we can add in the Model a reverse reference to the Entity that uses the Model. This will allow the Model to be automatically deleted if it is not referenced by any Entity.
In the future we may support sharing Models across Namespaces.