Database Columns / Model Fields
Define all the columns needed for your tables.
By clicking on the plus button () that appears on the right of each column you can add a new column after the selected one.
Use the delete button () to delete the corresponding column.
Two icons may optionally appear to the right of each column name:
Definition
Define the database column/model field attributes.
This section allows you to easily set up the field in the database and select what it represents.
We call this the column’s semantic meaning. It’s different from the column’s data type (though it sometimes sounds similar) and it helps Hatthi to automatically filter options with more granularity, where needed.
To give you an example of where it can come in handy, think of two columns, one storing email addresses, the other storing image urls. Both will have the data type “text”, but they hold data with completely different use. By setting their semantic meaning, Hatthi will know exactly what they are for and, if you’ll be wanting to add an email link dynamically connected to a model in the WYSIWYG editor, it will only allow you chose the model fields with the semantic meaning set to “email”, instead of all the fields with the data type “text”.
Type the name of the field and select its data type.
Based on the selected type you can further define the following:
Validation
You can also set validation rules for each field.
This is optional but considered a good practice, as it ensures that the information entered by users adheres to the required format.
It can be especially useful when populating or updating the fields in your model.
Add a validation rule by clicking the plus button () and selecting one of the available rules.
After selecting a rule, fill in the parameters values for that rule if needed.
Delete the inserted rule by clicking the delete button ().
Hidden Field
Toggle the visibility of a table column/model field from the JSON representation of the model.
When checked, the selected table column/model field wil be hidden in the JSON representation of the model.
Api Resource
Toggle the presence of a table column/model field in the Api Resource of the model.
When checked, the selected table column/model field wil be available in the Api resource of the model.
Optionally you can set the name in the Api resource; by default, it will be the same as the field name.