# HG changeset patch # User Franck Deroche # Date 1258707427 -3600 # Node ID 7bb375e191b16fbe764067c6611cbbecc4fe6272 # Parent 50a57b1517cbcdcbd23da068fc731b4b7c9e4533 Fix bogus primary key constraint: add 'field' to the key. diff -r 50a57b1517cb -r 7bb375e191b1 mee.install --- a/mee.install Fri Sep 18 15:18:53 2009 +0200 +++ b/mee.install Fri Nov 20 09:57:07 2009 +0100 @@ -42,6 +42,14 @@ return $ret; } +/** + * Include the 'field' field in the primary key. + */ +function mee_update_6002() { + $ret = array(); + $ret[] = update_sql("ALTER TABLE {mee_ressources} DROP PRIMARY KEY, ADD PRIMARY KEY(content_nid, atom_sid, field)"); + return $ret; +} /** * Implementation of hook_schema(). @@ -55,7 +63,7 @@ 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), 'required' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), ), - 'primary key' => array('content_nid', 'atom_sid'), + 'primary key' => array('content_nid', 'atom_sid', 'field'), ); return $schema;