[wp-hackers] Recommended way to change column name?

Mike Walsh mike_walsh at mindspring.com
Sun May 30 11:55:02 UTC 2010

I have a plugin which has its own tables.  One of the tables I had created a
while back for some future functionality that I am just getting to
implementing.  In the course of working on it I decided that I didn't need
several of the columns and more importantly, I wanted to change the name of
the primary index column to be more descriptive than the generic "id" name I
gave it originally.


I use dbDelta() to create my tables.  So I changed the SQL to reflect the
new updated table I wanted but the call to dbDelta() doesn't seem to have
any affect other than adding columns.  Doing some searching it appears
dbDelta() has some limitations and I am wondering if changing column names
is one of them.  Because I have never used this table I suppose I could
check for existence and drop it and let dbDelta() recreate it but I am
wondering what the recommended way to make table changes is?







Mike Walsh - mike underscore walsh at mindspring dot com


More information about the wp-hackers mailing list