In some use cases, it is essential to create a distinction within the same database.
If we want to split a database into two, we will need to create two child databases.
1. What is a child database within databases?
Ermeo allows you to create databases. All resources present in the same database will have the same attributes.
In a database, we can define child databases also called "sub-databases".
In this case, there will be an inheritance of attributes. The existing attributes for the database will also exist for the child databases.
2. In practice, how to create child databases?
Context: Let's imagine a company that inspects thousands of rails across Europe. These rails are resources stored in a database called "Rails".
Each resource in the database will be characterized by the following attributes:
- Rail Length
- Rail Thickness
- Rail Year
The company wants to add an attribute to qualify the rail standard. This standard is not the same between France and England.
We will create a first child database named 'Rails England". This child database will have the attribute "England Standard".
Then, we will create a second child database named "Rails France". This child database will have the attribute "France Standard".
- In the Databases tab, click on New Database.
- Create a new database. Name it "Rails". Do not choose a parent database.
- Add the following attributes:
- Rail Length (of Number type)
- Rail Thickness (of Number type)
- Rail Year (of Number type)
4. Go back to the Databases list and create a new database. Name it Rails France. Select the newly created "Rails" database as the parent database.
- Based on the Rails France database, add an attribute of type Multiple Choices and name it "Norme France".
Enter the following values for multiple choices:
- NF 1435 mm
- NF 1700 mm
- Repeat operation 6 by replacing the term France with England. Enter the following values for multiple choices:
- NUK 1524 mm
- NUK 1628 mm
You have created your two child databases "Rails France" and "Rails England". These two sub-databases appear in the "Rails" database.
You can now create resources in each of the sub-databases.
- The resources created in the sub-database "Rails England" will have the attribute "Norme England".
- The resources created in the sub-database "Rails France" will have the attribute "Norme France".