[wp-hackers] Help with dbDelta

Mike Walsh mike_walsh at mindspring.com
Wed Jan 26 15:34:48 UTC 2011


I have a plugin that manages a swim team that I've developed over the last
couple years.  It uses some custom tables to store all of the swim team
information.  I've used dbDelta() to create the tables in the past (based on
recommendations from the CodeEx and this list) and it has worked fine for
new tables or new columns in existing tables.  Yesterday I realized that one
of the tables had a mistake in it due to a typo.  I fixed it and changed the
database version number of use for checking and dbDelta() did not update the
table as I expected.  My question is this:

Is dbDelta() still the suggested method for creating and updating custom
tables?
What is the best way to check for and handle problems when dbDelta() does
not update a table?

Thanks,

Mike

--
Mike Walsh - mike underscore walsh at mindspring dot com




More information about the wp-hackers mailing list