I am trying to create a new column inside the wp_posts
table but I am getting the error #1067 - Invalid default value for 'post_date'
when I try and save it. What I am trying to do is, I am getting some data from an external API that I am saving in my Database and then I was to be able to check if the data exists in my DB, which is why I am trying to create a column inside the wp_posts
table to save the unique ID of the data from the API. The following is the SQL query. I am trying to do this using the PhpMyAdmin.
ALTER TABLE `wp_posts` ADD `apipostid` VARCHAR(20) NULL AFTER `ID`;
wp_posts
table. Instead, add the apipostid as post meta. See, eg,update_post_meta()
.