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.

On the right of each column name two icons may optionally appear:

  • indicates that the current column/model field will be hidden in the json representation of the model.
  • indicates that the current column/model field will be available in the model's Api resource.

Definition

Define the database column/model field attributes.

This section allows you to easily setup the field in the database and its semantic meaning. Select what the field represents.
This is its semnatic meaning, not its data type.
A text column could represent an image, for example, by holding the image's URL in it, or an email, storing an email address.

Type the name of the field and select its type.

Based on the selected type you can further define the following:

  • The unsigned attribute
  • The length of the field
  • The autoincrement attribute
  • The default value
  • The extra ON UPDATE CURRENT_TIMESTAMP attribute
  • The allow null attribute

Validation

Optionally setup how each field should be validated.
This settings do not make much sense for the database purposes, but can turn useful when defining routes, in particular non GET routes.

Add a validation rule by clicking the plus button () and selecting from the available rules.

After selecting a rule, if the case, fill in the parameters values for that rule.

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, which be the same as the field by default.