Index: promotion.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/promotion/promotion.install,v
retrieving revision 1.4
diff -u -F^f -r1.4 promotion.install
--- promotion.install	4 Jun 2007 17:00:38 -0000	1.4
+++ promotion.install	15 Aug 2007 09:54:15 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: promotion.install,v 1.4 2007/06/04 17:00:38 hanenkamp Exp $
+// $Id: promotion.install,v 1.1.2.2 2007/05/25 22:07:46 hanenkamp Exp $
 
 function promotion_install() {
   switch ($GLOBALS['db_type']) {
@@ -19,6 +19,7 @@ function promotion_install() {
       expiration_action int(1) unsigned NOT NULL default '0',
       code_type int(1) unsigned NOT NULL default '0',
       simple_code varchar(30) NOT NULL default '',
+      autogen_code_seed varchar(128) NOT NULL default '',
       advanced_validator text NULL,
       max_use_count int unsigned NULL,
       bypass_verification int(1) unsigned NOT NULL default '0',
@@ -83,4 +84,24 @@ function promotion_update_2() {
   return $items;
 }
 
+function promotion_update_3() {
+  $items = array();
+  switch ($GLOBALS['db_type']) {
+  case 'mysql':
+  case 'mysqli':
+    $items[] = update_sql("ALTER TABLE {promotion_codes}
+      ADD autogen_code_seed varchar(128) NOT NULL default '';");
+    
+    // autogen_code_seed is only set on insert, 
+    // so populate existing records now.
+    $items[] = update_sql("
+      UPDATE {promotion_codes}
+      SET autogen_code_seed = sha1(now() + pid);
+    ");
+
+    break;
+  }
+  return $items;
+}
+
 ?>
