phpgroupware-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-tracker] [bugs #8615] phpgw_contact_org_person - 2 primary


From: Dirk Schaller
Subject: [Phpgroupware-tracker] [bugs #8615] phpgw_contact_org_person - 2 primary keys - no auto increment
Date: Mon, 19 Apr 2004 09:46:55 -0400
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)

This mail is an automated notification from the bugs tracker
 of the project: phpGroupWare.

/**************************************************************************/
[bugs #8615] Latest Modifications:

Changes by: 
                Dirk Schaller <address@hidden>
'Date: 
                Mon 04/19/04 at 13:46 (GMT)

------------------ Additional Follow-up Comments ----------------------------
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







/**************************************************************************/
[bugs #8615] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=8615>
Project: phpGroupWare
Submitted by: Dirk Schaller
On: Mon 04/19/04 at 09:20

Category:  API - phpGWapi
Item Group:  devel cvs
Severity:  7 - Major
Priority:  7 - High
Resolution:  None
Assigned to:  jarg
Status:  Open
Component Version:  CVS
Platform Version:  None
Reproducibility:  None


Summary:  phpgw_contact_org_person - 2 primary keys - no auto increment

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.

Follow-up Comments
------------------


-------------------------------------------------------
Date: Mon 04/19/04 at 13:46         By: dschaller
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













For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=8615>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]