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_staff
defines the type of User (ifis_staff
is True, then Mechanic else Customer);
- Table Orders:
- Field
owner_id
references a User whoseis_staff
is False; - Field
mechanic_id
references a User whoseis_staff
is True.
Users with is_staff
== True cannot be customers.
Is this layout correct or are there better solutions?
is_staff
== True cannot be customers" a Business Requirement or an observation of your schema design?