0

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

MrFoh
  • 2,693
  • 9
  • 42
  • 77

1 Answers1

0

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

Sloth
  • 172
  • 8
  • It looks like you save address information, then you can make an Address entity and make a foreign key to that table, address information does not change a lot so you don't have to worry about extra columns you want to add over time – Sloth Jan 13 '15 at 09:39