One of the features that are supported by Kodika Server but not in typical Sheets is Relationships between Data Types. Relationships are a logical connection between the same or different Data Types, established on the basis of interaction among these Data Types.
Each Relationship consists of a from/parent and a to/target Data Type, which could also be the same. In addition, it defines the relationship type between them.
The Relationship Type is usually defined using the terms
Many and in the format [parent] to [target].
Available relationship types are:
- One to Many
- Many to One
- Many to Many
- One to One
In the next example, you can check how each Relationship type looks like if the from/parent is a User Data Type and the to/target is a Pet Data Type.
- Go to Kodika Server Data Types.
- Open the Data Type that you will use as from/parent Data Type.
- Press the + Add Property button.
- Select from the Server Data Types section the to/target Data Type. Note: You can select again the from/parent Data Type.
- Select the Relationship Type that will connect the two Data Types.
- Type in the name of the property that will be created in the from/parent Data Type and will be used by the new Relationship.
- Type in the name of the property that will be created in the to/target Data Type and will be used by the reversed Relationship.
In Kodika, every Relationship also has a reversed relationship. The reversed relationship exchanges the Parent with the Target Data types and reverses the relationship type.
A One to Many Relationship with User as parent and Pet as target, will also create a Many to One Relationship with Pet as parent and User as target.
There is a special case where you maybe need to use the same property for the reversed Relationship.
For example, if you need to create a friends relationship of type Many to Many, the reversed Relationship should use the same property.
Note: This special case works only for Many to Many and One to One.
You can only change the name of the properties of a Relationship and not their Data Types.
You can also delete a Relationship, but it will automatically delete also the reversed Relationship. It will also delete all the relationship values in the database but will keep the records.