Use a validator to keep the model in consistent with the alembic migration
This way we ensure the token_id cannot be null in the software level
since we cannot do that at the DB level.
We cannot do it at the DB level since for existing entries in the DB we
cannot find back what was the token_id. So there are two ways:
- have the model define nullable=False and the migration nullable=True
- be consistent between the model and the migration and enforce
nullable=False for new entries in the software.
This commit applies the second option.