I'm wondering if there is a good justification for having both location_node as well as location_user... right now there are 2 nearly identical tables (except for the changed name for the primary key).

On the off-chance that there's not a real good reason for this, I would propose that this module use a single table for all locative data (say, called "locations") that uses a bit more normalized structure:

i would recommend changing 'nid' to be 'oid' (o is for object) and add a 'type' column (that could be 'node', 'user' and perhaps even 'term'). this would allow some more (desired) use cases - such as "find everything in my city" or the re-use of "named" locations - i.e. "my house" is both "my location" and also the location for the house party I'm having... etc.

I've not, yet, done a patch for this, however, if desired it can be arranged.

CommentFileSizeAuthor
#4 location.module_2.diff5.29 KBankur
#3 location.module_1.diff6.16 KBankur

Comments

robertdouglass’s picture

Good call James. This will solve the venu problem when we work with Upcoming.org's API.

ankur’s picture

Status: Active » Needs review

Here's a patch I'm testing and thinking of committing once I get some feedback. It changes location so that location.module assumes a single database table called {location}, in place of location_user and location_node.

A database update for testing the patch is available in the cvs:
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/location/loca...

If this schema change works without breaking anything, I'd like to commit it and move on to other bugs/feature-requests in the queue. I just want to make sure the schema is solid before any other development happens...

-Ankur

ankur’s picture

StatusFileSize
new6.16 KB
ankur’s picture

StatusFileSize
new5.29 KB

Woops. Forgot to remove some print statements from the patch.

ankur’s picture

Status: Needs review » Fixed

Applied to HEAD, DRUPAL-4-6.

For existing users, to take advantage of this update, you will want to download the location_upgrade.php file from CVS and put it in the base directory of your install. To all current users of the module: you will eventually need to run this update.

There are some changes to the database schema.

-Ankur

yossarian’s picture

Version: 6.x-3.x-dev » 4.6.x-1.x-dev
Category: feature » bug

Applying this change to 4.6 breaks the event finder module.

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)