Entity
Entity is a collection of table structures that exist in an application's database. This menu allows users to create, change, and delete Entities.
The entity that has been created will later be used by the application itself for data processing needs. Each Entity will automatically generate an API which will then be used in the Workflow menu.
Entity Composer View
- Left Sidebar : A collection of Entity lists that have been created.
- Diagram Area: Entity diagram along with its relation and data structure.
- Right Sidebar : Entity field's property.
- Toolbar : Consist of Save button, migrate button, enable media attachment button, and diagram display options.
Data Structure
Data Type
Entities created on this platform support the following defined data types:
Data Type | Description | Sample usage |
---|---|---|
id | stores id using uuid format | id |
text | stores text with 1-255 characters | name, departmen |
longtext | stores text up to more than 255 characters | description |
number | stores integer | age |
decimal | stores floating number | price, discount rate |
date | stores date (yyyy-mm-dd) | date joined |
time | stores time (hh:mm:ss) | attendance clock in |
datetime | stores date dan time (yyyy-mm-dd hh:mm:ss) | date created |
boolean | stores true/false value | is_active |
media | stores media (file / image) | photo, attachment |
Create Entity
To create new entity, click the + icon on the left sidebar. Once Create new entity modal has been shown, input desired entity name then click add. Your new entity will be shown on the diagram area.
Delete, Rename, and Duplicate Entity
To do these actions, click the Entity on the left sidebar.
Then click any option according to your action.
Add, Edit, or Remove Entity's Field
In the diagram area, click the Entity whose structure you want to modify. The Entity structure will appear on the right.
Add field
Press Add Field button.
Enter the field name, data type, maximum field length, default value. If required is checked, then the field cannot be empty. If make this field unique is checked, then the field cannot contain the same data. If there is already the same data, an error will occur when migrating.
Press Save button.
In determining field names, there are field names that have been reserved by the platform and cannot be used by users. You will get error message if your field name already reserved by the platform.
Edit field
Users can change field properties such as names, data types, default values, and unique Click the Entity to be changed. Then select the field to be changed and click the pencil button.
Click Save button to apply the changes.
Note:
1 . Fields with certain data types cannot be changed to other data types.
Data Type before | Supported target Data Type |
---|---|
id | text, longtext |
text | longtext, id, number, decimal, date, time, datetime |
longtext | text, id, number, decimal, date, time, datetime |
number | text, longtext, decimal |
decimal | text, longtext, number |
boolean | text, longtext, number |
date | text, longtext, datetime |
time | text, longtext |
datetime | text, longtext |
media | file |
Delete field
On the properties sidebar, click trash button to delete the field. Click delete button on the confirmation modal
Migrate
To save changes to all Entities made by the User, it is necessary to do Migrate. The Migrate process will generate a database structure based on the diagram in the Area Diagram.
If the changes have not been migrated, there will be an indicator in the form of circle on the Migrate button.
Click Migrate button.
Syncronize Entity Changes to Workflow
Since the entity is used by the workflow. We provide auto synchronize the entity changes to workflow that use the entity. Auto synchronize will be executed along with migration process.
This process will take some minutes depend on how much the affected workflow is. Please wait until the process finished.
Entity Relation
In the platform it is possible to create relationships between Entities. Generally, when defining Entity relationships in designing a database, the User creates a foreign key field as a reference for the relationship, but on the Platform the foreign key field is automatically created.
Create Relation
As an illustration, there are 2 Entities in the Diagram Area.
Hover to the Entity to which the relationship will be created. Click the black dot, drag and drop to the destination Entity
Click Migrate button to apply the changes.
Relation Type
- 1 - 1 (One to One)
- 1 - Many (One to Many)
- Many - 1 (Many to One)
Delete Relation
Click the relation to be deleted. Then press Delete on you keyboard.
Media Attachment
Media Attachment is a special entity for storing metadata records from a file uploaded to the application. This entity cannot be renamed or modified in structure. This entity can only be activated and deactivated.
If the Application needs to store files, this Entity must be activated first. In the Diagram Area, click anywhere other than Entity and Relationship.
Toggle the media attachment from OFF to ON. Once the media attachment has been turned to ON, the media attachment entity will be automatically created.
Entity Data Authorization
Platform provide authorization entity related to the selected entity. If the selected entity activate the authorization, new authorization entity will be automatically created. This entity can be used in the workfklow.
To activate authorization, click the entity. Then toggle "Authorization" from OFF to ON.