[development] schema API add column after

Darrel O'Pry darrel.opry at gmail.com
Mon Jun 9 19:26:01 UTC 2008

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>

> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20080609/42b3dc10/attachment.htm 

More information about the development mailing list