User model handling two separate database tables

Posted 8 months ago by BlastedAsh

So initially I had one User model and one UserController work with my database table 'Users'.

Due to how I refactored my database schema on paper I have something that looks like this :

Before, everything that was in my meta_users was in my users table. I added foreign key constraints on meta_users for user_id being linked to the users->id.

My question is, do I have to create a new separate model "meta_users" and then tie it in with my User model. Or can I just use the User model to work with both tables.

For example, before my registration page would input and mass assign all the fields into my User table. But with my new configuration, it would mass assign some fields into Users and some into Meta_users. What would be the best way to do this?

Thanks :)

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.