diff ad.install @ 1:948362c2a207 ad

update advertisement
author pierre
date Thu, 02 Apr 2009 15:28:21 +0000
parents d8a3998dac8e
children e5584a19768b
line wrap: on
line diff
--- a/ad.install	Fri Feb 20 14:04:09 2009 +0000
+++ b/ad.install	Thu Apr 02 15:28:21 2009 +0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: ad.install,v 1.2.2.4.2.27.2.7 2009/02/17 18:56:25 jeremy Exp $
+// $Id: ad.install,v 1.2.2.4.2.27.2.7.2.3 2009/03/27 20:11:13 jeremy Exp $
 
 /**
  * @file
@@ -284,48 +284,6 @@
     ),
   );
 
- /**
-  * The ad_hosts table is used to configure users that can display ads
-  * remotely.
-  */
-  $schema['ad_hosts'] = array(
-    'description' => 'The ad_hosts table is used to configure users that can display ads remotely. ',
-    'fields' => array(
-      'uid' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'unsigned' => TRUE,
-        'default' => 0,
-        'description' => '',
-      ),
-      'hostid' => array(
-        'type' => 'varchar',
-        'length' => 32,
-        'not null' => TRUE,
-        'default' => '',
-        'description' => 'Host from which acion was made.',
-      ),
-      'status' => array(
-        'type' => 'int',
-        'size' => 'tiny',
-        'not null' => TRUE,
-        'unsigned' => TRUE,
-        'default' => 0,
-        'description' => '',
-      ),
-      'description' => array(
-        'type' => 'text',
-        'not null' => FALSE,
-        'description' => 'Host from which acion was made.',
-      ),
-    ),
-    'primary key' => array('uid'),
-    'indexes' => array(
-      'status' => array('status'),
-      'hostid' => array('hostid'),
-    ),
-  );
-
   return $schema;
 }
 
@@ -341,9 +299,6 @@
  * Allow complete uninstallation of the ad module.
  */
 function ad_uninstall() {
-  // Remove tables.
-  drupal_uninstall_schema('ad');
-
   // Delete all ad content.
   $result = db_query("SELECT nid FROM {node} WHERE type = 'ad'");
   while ($node = db_fetch_object($result)) {
@@ -357,6 +312,9 @@
     variable_del($variable);
   }
   db_query("DELETE FROM {variable} WHERE name LIKE 'ad_block_quantity_%'");
+
+  // Remove tables.
+  drupal_uninstall_schema('ad');
 }
 
 /**
@@ -443,3 +401,43 @@
   drupal_flush_all_caches();
   return array();
 }
+
+/**
+ * Introduce "extra" field for ad statistics and clicks, optionally allowing
+ * add-on modules to provide additional granularity.
+ */
+function ad_update_6004() {
+  $ret = array();
+  db_add_field($ret, 'ad_statistics', 'extra',
+    array(
+      'type' => 'varchar',
+      'length' => 255,
+      'not null' => TRUE,
+      'default' => '',
+      'description' => 'Alow add-on modules to provide additional statistics granularity.',
+    ),
+    array('indexes' => array(
+      'extra' => array('extra'))
+    ));
+  db_add_field($ret, 'ad_clicks', 'extra',
+    array(
+      'type' => 'varchar',
+      'length' => 255,
+      'not null' => TRUE,
+      'default' => '',
+      'description' => 'Alow add-on modules to provide additional statistics granularity.',
+    ),
+    array('indexes' => array(
+      'extra' => array('extra'))
+    ));
+  return $ret;
+}
+
+/**
+ * Flush all caches for AHAH ad type switcher to work.
+ */
+function ad_update_6005() {
+  drupal_flush_all_caches();
+  return array();
+}
+