Opened 12 years ago

Closed 12 years ago

#105 closed (fixed)

the contact table on gmoc-db2 has email_address as a unique key

Reported by: chaos@bbn.com Owned by: pbohan@bbn.com
Priority: major Milestone: gmoc.py data submission debugging
Component: Database Version:
Keywords: Cc:
Dependencies:

Description (last modified by chaos@bbn.com)

The contact table on gmoc-db2 is defined as:

CREATE TABLE `contact` (
  `contact_id` int(11) NOT NULL auto_increment,
  `email_address` varchar(80) NOT NULL,
...
  `urn` varchar(128) default NULL,
  PRIMARY KEY  (`contact_id`),
  UNIQUE KEY `contact_idx` (`email_address`),
...

This is incorrect:

  • The unique key for contacts should be URN, not e-mail
  • When a new submission is made which has a matching e-mail address, but a different URN, that should become a new entry, not use the existing entry.
  • Once URN is the unique key, when a new submission is made which has a matching URN, the code should use that entry rather than inserting a new entry.

Change History (6)

comment:1 Changed 12 years ago by sedwards@bbn.com

I agree for two reasons:

(1) The documentation for the client says that the ID is the URN and what you said makes complete sense.

(2) That is people should be able to change their e-mail without becoming a completely new person.

comment:2 Changed 12 years ago by chaos@bbn.com

Description: modified (diff)

comment:3 Changed 12 years ago by chaos@bbn.com

The contact table is now defined as:

CREATE TABLE `contact` (
  `contact_id` int(11) NOT NULL auto_increment,
  `email_address` varchar(80) NOT NULL,
...
  `urn` varchar(128) default NULL,
  `last_update` int(10) default NULL,
  PRIMARY KEY  (`contact_id`),
  UNIQUE KEY `urn` (`urn`),

So, that looks right. However, i submitted data containing:

        <contact email="chaos@bbn.com" given_name="Chaos" last_name="Golubitsky" urn="urn:publicid:IDN+pgeni1.gpolab.bbn.com+user+chaos"/>

and:

        <contact email="chaos@bbn.com" given_name="Chaos" last_name="Golubitsky" urn="urn:publicid:IDN+pgeni.gpolab.bbn.com+user+chaos"/>

and the database still contains only:

(155,'chaos@bbn.com','Chaos','Golubitsky','617-823-7169',NULL,1341594393,'',1341594309,'urn:publicid:IDN+pgeni1.gpolab.bbn.com+user+chaos',NULL)

(and no other contact entries involving "chaos").

Therefore, i expect that the script which updates the database is looking for an e-mail address, and matching on it rather than trying to match on URNs.

comment:4 Changed 12 years ago by sedwards@bbn.com

Owner: changed from somebody to pbohan@bbn.com

Kevin thinks this will require a fix to the client.

comment:5 Changed 12 years ago by sedwards@bbn.com

Ok. Here's our current thinking.

We believe that the slice creator should be and is a Contact.

But we believe the slice's primaryContact is a Contact but should be an arbitrary email address. Kevin is adding a text field to Slice right now.

comment:6 Changed 12 years ago by chaos@bbn.com

Resolution: fixed
Status: newclosed

There are now two entries in contact which have e-mail address chaos@bbn.com:

(155,'chaos@bbn.com','Chaos','Golubitsky','617-823-7169',NULL,1341594393,'',1341594309,'urn:publicid:IDN+pgeni1.gpolab.bbn.com+user+chaos',NULL),(197,'chaos@bbn.com','Chaos','Golubitsky',NULL,NULL,0,'',0,'urn:publicid:IDN+pgeni.gpolab.bbn.com+user+chaos',NULL);

Excellent. This is fixed.

Note: See TracTickets for help on using tickets.