[development] Adding to core tables
nan_wich at bellsouth.net
Mon Jul 12 16:46:35 UTC 2010
Pierre, if the data was that important, I would add it to another table and
maybe even normalize it. This is stuff like the name and company of the
commenter - both about as important as the email address that is already there.
This is just not serious stuff in this case.
Nancy E. Wichmann, PMP
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
From: Pierre Rineau <pierre.rineau at makina-corpus.com>
To: development at drupal.org
Sent: Mon, July 12, 2010 12:33:35 PM
Subject: Re: [development] (no subject)
Le lundi 12 juillet 2010 à 09:19 -0700, nan wich a écrit :
> Is there an official stance on using hook_schema_alter to add columns
> to core tables? For example, we collect additional data on anonymous
> comments and want to actually save that data. Rather than creating
> another table (and subsequent JOINs), I'd just as soon stuff that data
> into the comments table, where it belongs. Should we ever disable
> comments (unlikely), we probably wouldn't mind losing that data too.
> Nancy E. Wichmann, PMP
> Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L.
> King, Jr.
I would say, create a new table instead of populating core one.
Each time you'll update your statistics, it will update the core
database row, which should have not been updated. It will break most of
the DBMS query cache, you will drastically lower your site performances
if you have a lot of data. Ever worst, some DBMS do important physical
row moves on each update (like PostgreSQL), this is no good, if you
don't have to update a row, don't update it.
You will may also experience some weird behaviors, like other modules
dropping rows and recreating them identically, then loosing your
statistics if they do not use drupal_write_record().
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the development