--- geouser.install	2009-02-05 15:36:27.000000000 -0500
+++ geouser.install.old	2009-02-02 17:29:26.000000000 -0500
@@ -1,57 +1,30 @@
 <?php
-// $Id:$
+// $Id: geouser.install,v 1.6 2008/04/08 05:57:13 zidong Exp $
 
 /**
  * Implement hook_install()
  *
  */
 function geouser_install(){
-    drupal_install_schema('geouser');
-}
- 
-/**
- * Implement hook_schema()
- *
- */
-function geouser_schema(){    
-  $schema['geouser'] = array(
-    'description' => t("The table for storing user locations"),
-    'fields' => array(
-      'uid' => array(
-        'description' => t("Drupal User ID"),
-        'type' => 'int',
-        'unsigned' => TRUE, 
-        'not null' => TRUE, 
-        'disp-width' => '10'
-      ),
-      'addr' => array(
-        'description' => t("User's IP address when last logged in"),
-        'type' => 'varchar', 
-        'length' => '32', 
-        'not null' => TRUE
-      ),
-      'country' => array(
-        'description' => t("User's country returned from GeoIP"),
-        'type' => 'varchar', 
-        'length' => '32', 
-        'not null' => TRUE
-      ),
-      'region' => array(
-        'description' => t("User's region returned from GeoIP"),
-        'type' =>'varchar',
-        'length' => '32',
-        'not null' => TRUE
-      ),
-      'city' => array(
-        'description' => t("User's city returned from GeoIP"),
-        'type' => 'varchar', 
-        'length' => '32', 
-        'not null' => TRUE
-      )
-    ),
-    'primary key' => array('uid'),
-  );
-  return $schema;
+    
+    switch($GLOBALS['db_type']){
+        
+        case 'mysql':
+        case 'mysqli':
+            db_query("
+            
+            CREATE TABLE IF NOT EXISTS {geouser}(
+               uid int(10) unsigned not null,
+               addr varchar(32) not null,
+               country varchar(32) not null,
+               region varchar(32) not null,
+               city varchar(32) not null,
+               PRIMARY KEY (uid)
+            );
+            ");
+            break;
+                
+    }
 }
 
 /**
@@ -59,23 +32,5 @@
  *
  */
 function geouser_uninstall(){
-  drupal_uninstall_schema('geouser');
+    
 }
-
-/**
- * Implement hook_update_N()
- *
- */
-function geouser_update_6000(){
-  $ret = array();
-  db_add_field($ret, 'geouser', 'region', array(
-      'description' => t("User's region returned from GeoIP"),
-      'type' =>'varchar',
-      'length' => '32',
-      'not null' => TRUE
-    )
-  );
-  return $ret;
-}
-
-
