summaryrefslogtreecommitdiff
path: root/modules/trigger/trigger.install
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-02-14 13:38:17 -0500
committerwebchick <webchick@24967.no-reply.drupal.org>2012-02-14 13:38:17 -0500
commit8ec3a4d9c4968f615979f2fa73f12764cf06b00e (patch)
tree7667281f3aeeee3d44744590185abe9ef344185c /modules/trigger/trigger.install
parentd6710e4122a0889d00c5e4d4ce376cc4268b1afc (diff)
downloadbrdo-8ec3a4d9c4968f615979f2fa73f12764cf06b00e.tar.gz
brdo-8ec3a4d9c4968f615979f2fa73f12764cf06b00e.tar.bz2
Issue #1280792 by xjm, julien, BTMash, pingers: Fixed {trigger_assignments()}.hook has only 32 characters, is too short.
Diffstat (limited to 'modules/trigger/trigger.install')
-rw-r--r--modules/trigger/trigger.install12
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/trigger/trigger.install b/modules/trigger/trigger.install
index 9a172a2a0..5ed40776b 100644
--- a/modules/trigger/trigger.install
+++ b/modules/trigger/trigger.install
@@ -9,12 +9,14 @@
* Implements hook_schema().
*/
function trigger_schema() {
+ // The total index length (hook and aid) must be less than 333. Since the aid
+ // field is 255 characters, the hook field can have a maximum length of 78.
$schema['trigger_assignments'] = array(
'description' => 'Maps trigger to hook and operation assignments from trigger.module.',
'fields' => array(
'hook' => array(
'type' => 'varchar',
- 'length' => 32,
+ 'length' => 78,
'not null' => TRUE,
'default' => '',
'description' => 'Primary Key: The name of the internal Drupal hook; for example, node_insert.',
@@ -68,3 +70,11 @@ function trigger_update_7000() {
}
db_drop_field('trigger_assignments', 'op');
}
+
+/**
+ * Increase length of hook name field to 78 characters.
+ */
+function trigger_update_7001() {
+ db_drop_primary_key('trigger_assignments');
+ db_change_field('trigger_assignments', 'hook', 'hook', array('type' => 'varchar', 'length' => 78, 'not null' => TRUE, 'default' => '', 'description' => 'Primary Key: The name of the internal Drupal hook; for example, node_insert.', ), array('primary key' => array('hook', 'aid')));
+}