I think, this is the problem of sqlite.
Very first item says:
FOREIGN KEY constraints
are parsed but are not enforced. However, the equivalent constraint enforcement
can be achieved using triggers. The SQLite source tree contains source
code and documentation
for a C program that will read an SQLite database, analyze the foreign key
constraints, and generate appropriate triggers automatically.
It is very likely that my initial classes were correct
(just ForeignKey), and also the database schema is correctly created by