Step 2: Entity Types
Now you create the two kinds of objects of the movie database: Actor and Movie. Background: Entity Types and Properties.
Create the Entity Type Actor
-
Open Administration → Datamodel → Entity Types.
-
Click and fill in the dialog:
Field Value Name actorLabel Actor (DE: Schauspieler) Plural Label Actors (DE: Schauspieler) Description A person who acts in movies Icon Lucide:UserRound -
Click Submit and open the new entity type by clicking the message.
Add the Properties of Actor
On the tab Properties, add three properties with Link existing. For each one, select the property type, fill in the Relationship Properties and click Submit:
| # | Name | Label | Property type | Required |
|---|---|---|---|---|
10 | first_name | First name (DE: Vorname) | string_property_type/generic | on |
20 | last_name | Last name (DE: Nachname) | string_property_type/generic | on |
30 | birth_date | Date of birth (DE: Geburtsdatum) | datetime_property_type/generic | off |
The number in # sets the order of the fields — in the create dialog, on the Data Sheet and in the search table.
Create the Entity Type Movie
Create a second entity type the same way:
| Field | Value |
|---|---|
| Name | movie |
| Label | Movie (DE: Film) |
| Plural Label | Movies (DE: Filme) |
| Description | A feature film |
| Icon | Lucide:Clapperboard |
Add the Properties of Movie
| # | Name | Label | Property type | Required |
|---|---|---|---|---|
10 | title | Title (DE: Titel) | string_property_type/generic | on |
20 | release_year | Release year (DE: Erscheinungsjahr) | int_property_type/generic | on |
30 | runtime_minutes | Runtime (minutes) (DE: Laufzeit (Minuten)) | int_property_type/generic | off |
40 | genre | Genre (DE: Genre) | enum_property_type/genre | off |
Enter a Description for each property, for example Year of the first release for release_year. It appears as a tooltip on the field and on the column header of the search page.
Try It
- Open the search page of the new type:
/search/movie. The table shows the columns Title, Release year, Runtime (minutes) and Genre, in this order. - Create one movie by hand with : Casablanca,
1942,102, genre Drama. The genre is a dropdown with the entries of your enum.
You will import the other movies in step 5. Delete Casablanca again, or keep it and remove the line from movies.csv before importing.
Every change to an entity type is a new commit of the type. Entities that already exist only see the change after Upgrade Entity Type — see Model Changes and Existing Data. As long as you have no data yet, this does not matter.