Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7781983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:23:52+00:00 2026-06-01T19:23:52+00:00

In my application I have two tables: Users and Profiles. A user has a

  • 0

In my application I have two tables: Users and Profiles. A user has a profile and profile belongs to a user. The reason I did this was because I wanted to keep the tables simple and the controllers smaller for each e.g. The UserController deals with logins, forgot passwords etc and ProfileController deals with edit, profile view etc.

Now when linking to other models e.g. Posts or Comments or Friends I have run into a dilema!

Currently I Posta and Comments to the User via a user_id foreign key and then pull in the Profile info using a contain in the query but for Friends I link via the Profile ID.

So what would be the better option? As it seems better to link through the Profile id as that is more relevant and in the future should a user have additional stuff .e.g Groups or Pages (think Facebook) then it would be hard to differentiate between what is linked to the Profile and what is linked to the Group or Page for the same user.

I know this is a slightly open question BUT it’s something that would help me if others could share there thoughts, especially with performance and code efficiency.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:23:53+00:00Added an answer on June 1, 2026 at 7:23 pm

    Linking the friends using the profile ID makes no sense to me (since friends is a recursive relation on the users table).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have this application in ASP MVC 3. My database has two tables:
I have two RoR3 application: http://users.domain.local http://profiles.domain.local I created the 'users/models/profile.rb': class Profile <
I have a SQL database with two tables like this: Users Id (PK) Name
I basically have two tables called images and users . The images table has
We have two tables in our application that both have a ShowOrder column. We
I am trying to develop an application using ADO.NET. I have two tables in
I have an ASP.NET Dynamic Data application that includes two tables, Departments and KPI's
In my application I have two tables (I have more but I'm only discussing
Scenario : I have a users table in my application. I also have two
I'm building an application that will have two different types of users, lets call

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.