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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | location.module_2.diff | 5.29 KB | ankur |
| #3 | location.module_1.diff | 6.16 KB | ankur |
Comments
Comment #1
robertdouglass commentedGood call James. This will solve the venu problem when we work with Upcoming.org's API.
Comment #2
ankur commentedHere'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 oflocation_userandlocation_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
Comment #3
ankur commentedComment #4
ankur commentedWoops. Forgot to remove some print statements from the patch.
Comment #5
ankur commentedApplied 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
Comment #6
yossarian commentedApplying this change to 4.6 breaks the event finder module.
Comment #7
(not verified) commentedComment #8
(not verified) commentedComment #9
(not verified) commentedComment #10
(not verified) commentedComment #11
(not verified) commented