[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-tracker] [bugs #8615] phpgw_contact_org_person - 2 primary
From: |
Jonathan Rivera |
Subject: |
[Phpgroupware-tracker] [bugs #8615] phpgw_contact_org_person - 2 primary keys - no auto increment |
Date: |
Sat, 01 May 2004 01:53:11 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031226 Epiphany/1.2.2 |
This mail is an automated notification from the bugs tracker
of the project: phpGroupWare.
/**************************************************************************/
[bugs #8615] Latest Modifications:
Changes by:
Jonathan Rivera <address@hidden>
'Date:
Sat 05/01/04 at 05:53 (GMT)
What | Removed | Added
---------------------------------------------------------------------------
Resolution | None | Works for me
------------------ Additional Follow-up Comments ----------------------------
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.
/**************************************************************************/
[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: Works for me
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: Sat 05/01/04 at 05:53 By: jarg
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.
-------------------------------------------------------
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/
- [Phpgroupware-tracker] [bugs #8615] phpgw_contact_org_person - 2 primary keys - no auto increment,
Jonathan Rivera <=