bugphpGroupWare - Bugs: bug #8615, phpgw_contact_org_person - 2...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #8615: phpgw_contact_org_person - 2 primary keys - no auto increment

Submitter:  Dirk Schaller <dschaller>
Submitted:  Mon 19 Apr 2004 09:20:53 AM UTC
   
 
Category:  API - phpGroupware API Item Group:  SVN trunk (dev code)
Severity:  4 - Important Priority:  7 - High
Status:  Works For Me Privacy:  Public
Assigned to:  jarg Open/Closed:  Closed
Component Version:  SVN Operating System:  None
Reproducibility:  None Planned Release:  None
Fixed Release: 

Sat 01 May 2004 05:53:09 AM UTC, comment #2: 

in phpgw_contact_org_person you have a compose key

org_id - person_id

and this would be unique, if you have in your db an existing compose key and you try to insert this again you have this error, if you want to modify the data you need do an update by org_id = your_org_id and person_id = your_person_id.

now, if you have this error in phpgw please check if is still here and tell me more details, where you have this error.

thanks.

Jonathan Rivera <jarg>
Mon 19 Apr 2004 01:46:53 PM UTC, comment #1: 

Im sorry! I didnt know about the two pri keys and their functionality in mysql. I check this again. A group of peron_id and org_id is unique. Good. So a person can be assigned to more than one orgs. But I didnt understand and found no reason why there is still a relation in db and I got the error message. Maybe, what happens with the existing realations when add a new releation? Would the old realations added agein (with sql insert), then I would explain the error message I got. Or would they updated (with sql update)?

Thanks for checking that!
Dirk

Dirk Schaller <dschaller>
Mon 19 Apr 2004 09:20:53 AM UTC, original submission:  

The phpgw_contact_org_person contains two primary keys (org_id and person_id) and no unique auto increment primary key. That has the effect that one person can be assigned only to one organization. When assigning a person to a secound org I get the message:

Database error: Invalid SQL: INSERT INTO phpgw_contact_org_person
(person_id, created_on, created_by, preferred, org_id) VALUES (940,
1082362689, 5013, 'N', 11)
MySQL Error: 1062 (Duplicate entry '11-940' for key 1)

File: /srv/www/htdocs/pbgroupware/phpgwapi/inc/class.sql_entity.inc.php
Line: 515

Session halted.


I would use a auto increment pk. The person_id and org_id should be foreign keys. Or if there shouldn't be the possibility to assign a person to more than one orgs, it should be tested and a messege should be shown.

Dirk Schaller <dschaller>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-05-05 jarg Open/ClosedOpen Closed
2004-05-01 jarg StatusNone Works For Me

Back to the top

Powered by Savane 3.13-4448.
Corresponding source code