I am a Yii newbie and I really need some help on configuring MYSQL database and models.
In my app I have three entities: users, bikers, swimmers.
Every user is a biker or a swimmer.
I am thinking to create three DB tables with the following data (exemplified) and configuration:
TABLE USERS users.id, users.name, users.category.
TABLE BIKER biker.id, biker.userid (reference to users table), biker.bike
TABLE SWIMMER swimmer.id, swimmer.userid (reference to users table), swimmer.style
Users.category stores if that user is a biker or a swimmer.
It’s like Bikers and Swimmers extend Users (talking in OOP jargon) and there’s a ONE_TO_ONE relationship between Bikers or Swimmers and Users table.
My aim is to do CRUD operations on Bikers and Swimmers (which of course reflect on users).
What’s your opinion? Is it a good configuration or it is better to have one big table which unifies everything? Probably I won’t have User actions, do I need Users model and controller?
Regards, Ciroxxx