Mercurial > defr > drupal > scald > mee
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 14:50a57b1517cb | 15:7bb375e191b1 |
|---|---|
| 40 break; | 40 break; |
| 41 } | 41 } |
| 42 return $ret; | 42 return $ret; |
| 43 } | 43 } |
| 44 | 44 |
| 45 /** | |
| 46 * Include the 'field' field in the primary key. | |
| 47 */ | |
| 48 function mee_update_6002() { | |
| 49 $ret = array(); | |
| 50 $ret[] = update_sql("ALTER TABLE {mee_ressources} DROP PRIMARY KEY, ADD PRIMARY KEY(content_nid, atom_sid, field)"); | |
| 51 return $ret; | |
| 52 } | |
| 45 | 53 |
| 46 /** | 54 /** |
| 47 * Implementation of hook_schema(). | 55 * Implementation of hook_schema(). |
| 48 */ | 56 */ |
| 49 function mee_schema() { | 57 function mee_schema() { |
| 53 'atom_sid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), | 61 'atom_sid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), |
| 54 'field' => array('type' => 'varchar', 'length' => 31, 'not null' => TRUE, 'default' => ''), | 62 'field' => array('type' => 'varchar', 'length' => 31, 'not null' => TRUE, 'default' => ''), |
| 55 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), | 63 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), |
| 56 'required' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), | 64 'required' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), |
| 57 ), | 65 ), |
| 58 'primary key' => array('content_nid', 'atom_sid'), | 66 'primary key' => array('content_nid', 'atom_sid', 'field'), |
| 59 ); | 67 ); |
| 60 | 68 |
| 61 return $schema; | 69 return $schema; |
| 62 } | 70 } |
