[development] schema API add column after

Ashraf Amayreh mistknight at gmail.com
Mon Jun 9 20:40:59 UTC 2008


It would be nice to patch it, but I'm sort of worried about upgrading to 6.x
for the time being. I'm tempted to think the guidelines for the update hooks
only apply to new update hooks and that users upgrading their installations
must upgrade to the latest 5.x version of the module before upgrading to
6.x, is this accurate?

On Mon, Jun 9, 2008 at 10:26 PM, Darrel O'Pry <darrel.opry at gmail.com> wrote:

> it would be nice if schema API handled this automatically based on index
> order in the schema array... That's what I would hope happens... If not
> maybe someone who wants this feature can write a patch for schema API.
>
> On Mon, Jun 9, 2008 at 2:43 PM, Nancy Wichmann <nan_wich at bellsouth.net>
> wrote:
>
>> Matej Svetlík wrote:
>>
>> > why do you need to have table column at specified position?
>>
>> I was trying to keep quiet, even though I have this same issue, but I
>> can't
>> now.
>>
>> Think about a new installation as opposed to an updated ("add column")
>> installation.
>>
>> In the new installation, my schema says the columns come in the order, a,
>> b,
>> c, etc. but let's say we now want to add column d. For a new installation,
>> it would look nicer to have it between b and c. The hook_schema can be
>> done
>> this way. But how does one tell MySql that we want it between b and c?  In
>> straight MySql, this is easy with the "AFTER COLUMN ..." cause.
>>
>> So, now you're going to ask, "What do you mean by 'it would look nicer'?"
>> So I'll give you an example that I'm actually working on right now. I have
>> a
>> node extension table that has nid, vid, name, and more text fields. I am
>> changing the name column from text to integer so that it can point to new
>> table.  I really prefer to keep integer columns (pointers) together. And,
>> in
>> this case, I am replacing one column with another (add new column, insert
>> data, delete old column), so it would be nice to have the new column be in
>> the "same place" the old one was before the update.
>>
>> Make sense?
>>
>> NancyDru
>>
>>
>> No virus found in this outgoing message.
>> Checked by AVG.
>> Version: 8.0.100 / Virus Database: 270.1.0/1492 - Release Date: 6/9/2008
>> 10:29 AM
>>
>>
>


-- 
Ashraf Amayreh
http://blogs.aamayreh.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20080609/f366765d/attachment.htm 


More information about the development mailing list