0
votes

Am working on a web app and I currently have three models 'User', 'Profile', 'CorporateProfile'. The Profile model serves a User who has an individual account and CorporateProfile for an corporate account. The tables; profiles and corporate_profiles have similar fields; street, city_id, phone, state_id. Am trying to figure out if it will be better to use a single profiles table to handle both User type accounts.

DB Schema

Users Table

  • id
  • email
  • password
  • first_name
  • last_name
  • name

Profile Table

  • id

  • user_id

  • photo

  • sex

  • dob

  • state_id

  • city_id

  • street

  • school_id

Corporate Profiles Table

  • id

  • user_id

  • logo

  • industry_id

  • state_id

  • city_id

  • street

  • description

1
Can you specify structures of all 3 tables!!adarsh hota
Take a look at this answerlukasgeiter

1 Answers

0
votes

it depends on what you main purpose is. If you have many selects on your database it may be better to keep these values in the tables. Otherwise it may be more valueable to make a new entity (ProfileInformation or something like that) to have shared values in one table