Skip to main content
Version: Next

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​

  1. Open Administration → Datamodel → Entity Types.

  2. Click and fill in the dialog:

    FieldValue
    Nameactor
    LabelActor (DE: Schauspieler)
    Plural LabelActors (DE: Schauspieler)
    DescriptionA person who acts in movies
    IconLucide:UserRound
  3. 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:

#NameLabelProperty typeRequired
10first_nameFirst name (DE: Vorname)string_property_type/genericon
20last_nameLast name (DE: Nachname)string_property_type/genericon
30birth_dateDate of birth (DE: Geburtsdatum)datetime_property_type/genericoff

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:

FieldValue
Namemovie
LabelMovie (DE: Film)
Plural LabelMovies (DE: Filme)
DescriptionA feature film
IconLucide:Clapperboard

Add the Properties of Movie​

#NameLabelProperty typeRequired
10titleTitle (DE: Titel)string_property_type/genericon
20release_yearRelease year (DE: Erscheinungsjahr)int_property_type/genericon
30runtime_minutesRuntime (minutes) (DE: Laufzeit (Minuten))int_property_type/genericoff
40genreGenre (DE: Genre)enum_property_type/genreoff

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​

  1. 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.
  2. 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.

Change your mind later?

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.

Next: Step 3: Cast Relationship