A system for a bike repair shop has 2 types of users: Mechanics and their Customers. The schema has this structure:
- Table Users:
- The boolean field
is_staffdefines the type of User (if
is_staffis True, then Mechanic else Customer);
- Table Orders:
owner_idreferences a User whose
mechanic_idreferences a User whose
is_staff == True cannot be customers.
Is this layout correct or are there better solutions?