Mercurial > defr > drupal > scald > mee
diff mee.install @ 15:7bb375e191b1
Fix bogus primary key constraint: add 'field' to the key.
| author | Franck Deroche <franck@defr.org> |
|---|---|
| date | Fri, 20 Nov 2009 09:57:07 +0100 |
| parents | 50a57b1517cb |
| children |
line wrap: on
line diff
--- 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;
