dbDelta Usage for Plugin
-
I have written a plugin and it creates a few tables when it is first activated. I have added a column to one of the tables and I would like to leverage dbDelta to make the changes to the table.
I am using the code to create tables from the codex: Creating Tables with Plugins. But the Create table statement is within the IF to determine if the table exists already. So if the table DOES exist, then dbDelta is never called.
If I remove the IF altogether then my table alteration works fine.
So what is the proper way to do this? Do I leave off the IF to test if the table exists? I would imagine so but according to the examples and other plugins I have checked, it is within the table check.
Thanks!!
- The topic ‘dbDelta Usage for Plugin’ is closed to new replies.