[SOLVED] What is the rellation between Account_Attribute and Account?

All Union Platform questions, comments, feature requests, and bug reports.

What is the rellation between Account_Attribute and Account?  

Postby goodguy » Sun 23 Sep 2012 09:10

Hi,
I hope Derek or Colin will answer this question, since I myself am completely stuck at this point but I do need to solve the problem in any way.

So, I'm trying to fetch values from Account_Attribute table where name equals "score" and find which account does this score belong to.
But I can find nothing in common between Account and Account_Attribute tables.

Account table has these columns: ID, CREATED_AT, UPDATED_AT, USERID, PASSWORD, MODERATOR
and Account_Attribute has these: ID, CLIENT, NAME, SCOPE, VALUE, FLAGS, CREATED_AT, UPDATE_AT

I can see that IDs from Account table correspond to CLIENT column from Account_Attribute table, but it's just a test table with 2 account records in it. So will it always be this way? I mean for all newly registered users (ACCOUNT -> ID) will be equal to (ACCOUNT_ATTRIBUTE -> CLIENT).
Can I compare ID to CLIENT to get the necessary values?
goodguy
 
Posts: 66
Joined: Sun 23 Oct 2011 01:47

Re: What is the rellation between Account_Attribute and Acco

Postby derek » Tue 06 Nov 2012 15:08

Hi goodguy,

The CLIENT column in the ACCOUNT_ATTRIBUTE table is indeed the key back to the ID column in the ACCOUNT table.

CLIENT is admittedly a misnomer since it should be something like ACCOUNT_ID but that's how it evolved. We may fix that in a future major release.

The other issue is that it's not truly a foreign key with all of the referential integrity that entails. There were complicated reasons why in our particular case we couldn't describe that relationship at a mapping level.

Hope that helps!

Derek
derek
 
Posts: 68
Joined: Mon 17 Oct 2011 19:12


Return to Union Platform

Online

Users browsing this forum: No registered users and 2 guests