Adding another model or table schema to your application is simple. You only need to create another class that inherits from Model
.
The model you will create next, Reader
, is simple and similar to Book
. Let us try it together. You can do this!
To make it easier for you, here’s the schema representation of Reader
:
We have already provided the Reader
class declaration and the representation method.
Instructions
Add to the model a column called name
that is of type String
with at most 50 characters. It is indexable and not unique.
Add to the model a column called surname
that is of type String
with at most 80 characters. It is indexable and not unique.
Add to the model a column called email
that is of type String
with at most 120 characters. It is indexable and unique.