Replace Enum by tables and foreign key

This leads to some adjustement in the create_table section to populate those tables and
enforce the foreign key constraint on sqlite.
Adjust the initialisation of the tests and use an infile database to enforce foreign key contraints
Some more adjustements to the tests now that we enforce foreign key in sqlite