Index: location.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/location/location.install,v retrieving revision 1.7.2.2 diff -u -F^f -r1.7.2.2 location.install --- location.install 2 Aug 2007 01:57:25 -0000 1.7.2.2 +++ location.install 27 Feb 2008 17:14:58 -0000 @@ -21,7 +21,7 @@ function location_install() { longitude decimal(10,6) default NULL, source tinyint default '0', is_primary tinyint NOT NULL default '0', - PRIMARY KEY (lid) + PRIMARY KEY (eid, lid) ) /*!40100 DEFAULT CHARACTER SET utf8 */; "); @@ -61,7 +61,7 @@ function location_install() { longitude decimal(10,6) default NULL, source smallint default '0', is_primary smallint default '0', - PRIMARY KEY (lid) + PRIMARY KEY (eid, lid) )"); db_query("CREATE TABLE {zipcodes} ( @@ -285,4 +285,21 @@ function location_update_7() { return $ret; -} \ No newline at end of file +} + +function location_update_8() { + $ret = array(); + switch ($GLOBALS['db_type']) { + case 'mysqli': + case 'mysql': + $ret[] = update_sql('ALTER TABLE {location} ADD PRIMARY KEY (eid)'); + break; + + case 'pgsql': + $ret[] = update_sql('CREATE INDEX {location}_eid_index ON {location} (eid)'); + break; + } + + return $ret; +} +